Re: inserting into an (Postgresql 10) interval type column using JPA

2022-03-31 Thread Max Kremer
> On Thu, Mar 31, 2022 at 3:20 PM Max Kremer wrote: > >> >> Hi Lukas, >> >>Where would I be able to do "CAST(? AS INTERVAL)"? I'm using JPA >> with @column annotation, not building the insert statement by hand, so I;m >> not sure where to perfor

Re: inserting into an (Postgresql 10) interval type column using JPA

2022-03-31 Thread Max Kremer
Hi Lukas, Where would I be able to do "CAST(? AS INTERVAL)"? I'm using JPA with @column annotation, not building the insert statement by hand, so I;m not sure where to perform the cast. ᐧ On Thu, Mar 31, 2022 at 12:38 AM Lukas Eder wrote: > Thanks for your message. > > What have you

Re: New datatypes JSON and JSONB are not serializable

2020-01-20 Thread Max Kremer
you can >> build jOOQ from sources and use that until the next patch release is >> available. >> >> Best regards, >> Knut >> >> On Saturday, January 18, 2020 at 5:54:24 PM UTC+1, Max Kremer wrote: >>> >>> After upgrading from vers

Re: New datatypes JSON and JSONB are not serializable

2020-01-18 Thread Max Kremer
Just realised the JSONB class is final so it can not be extended :( -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscr...@googlegroups.com.

New datatypes JSON and JSONB are not serializable

2020-01-18 Thread Max Kremer
After upgrading from version 3.10 to 3.12 we noticed that we had some problem with the new JSON datatypes. Specifically we were seeing: java.io.NotSerializableException: org.jooq.JSONB We we use REDIS caching with all our queries in the form of a MockDataProvider public class

Re: How to use UpdateableRecord without code generation

2019-09-12 Thread Max Kremer
Ok Thanks Knut, I'll explore the code generator. Regards, Max Kremer http://www.trialfire.com email: m...@trialfire.com twitter: @maxtrialfire skype: maxkremer ᐧ On Thu, Sep 12, 2019 at 10:30 AM Knut Wannheden wrote: > Hi Max, > > On Thu, Sep 12, 2019 at 4:20 PM Max Krem

Re: How to use UpdateableRecord without code generation

2019-09-12 Thread Max Kremer
ectly"* On Thursday, September 12, 2019 at 10:10:29 AM UTC-4, Knut Wannheden wrote: > > Hi Max, > > On Thu, Sep 12, 2019 at 4:02 PM Max Kremer > wrote: > >> Sorry I should've pointed out that I'm not using the code generator. >> > > I see. Just out of c

Re: How to use UpdateableRecord without code generation

2019-09-12 Thread Max Kremer
Sorry I should've pointed out that I'm not using the code generator. On Wednesday, September 11, 2019 at 3:54:07 PM UTC-4, Max Kremer wrote: > > I'm trying to perform some simple CRUD operations with JPA annotated Pojos. > > I've run into the need of returning the generated id (Iden

How to use UpdateableRecord without code generation

2019-09-11 Thread Max Kremer
I'm trying to perform some simple CRUD operations with JPA annotated Pojos. I've run into the need of returning the generated id (Identity columns) for records that are inserted. Seems that the best way to do this is with UpdateableRecord To date we've been using CustomRecord and its hasn't

Bind a Postgresql array to a java list instead of a java Array.

2019-08-21 Thread Max Kremer
Using Jooq 3.10 and Postgresql 10 - Not using the code generator I'm trying to improve some code that uses primitive arrays, specifically String[ ] . As everyone knows arrays can be clunky to work with, Lists are much preferred but I can't figure out how to bind a PostgreSQL array field to a

Re: Fetching a result set into a TYPE and providing addition information

2019-01-17 Thread Max Kremer
gt; > Hi Max, > > I would need a more complete example to help reproduce this issue. > > Thanks, > Lukas > > On Wed, Jan 16, 2019 at 10:16 PM Max Kremer > wrote: > >> Hey, sorry for reviving this thread but i noticed some strange behaviour. >> >> I g

Re: Fetching a result set into a TYPE and providing addition information

2019-01-16 Thread Max Kremer
UTC-6, Lukas Eder wrote: > > Yes of course, thanks for the correction > > On Sat, Dec 29, 2018 at 8:30 PM Max Kremer > wrote: > >> Hi >> >> Correction. >> >> .fetchInto(r -> r.into(new MyRow(helper))); >> vs >> .fetchInto(MyRow.class)

Re: Fetching a result set into a TYPE and providing addition information

2018-12-29 Thread Max Kremer
Hi Correction. .fetchInto(r -> r.into(new MyRow(helper))); vs .fetchInto(MyRow.class); The RowMapper example above should read .fetch(r -> r.into(new MyRow(helper))); >> -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To

Re: Fetching a result set into a TYPE and providing addition information

2018-12-27 Thread Max Kremer
Follow up. Is it possible to do the above using a plain string SQL query and not building the query "Jooq Style". I dont see any RecordMapper examples on DSLContext.fetch(String SQL) type queries On Thursday, December 27, 2018 at 11:52:38 AM UTC-5, Max Kremer wrote: > > AWE

Re: Fetching a result set into a TYPE and providing addition information

2018-12-27 Thread Max Kremer
ww.jooq.org/javadoc/latest/org/jooq/Record.html#into-E- > - > https://www.jooq.org/javadoc/latest/org/jooq/impl/DefaultRecordMapper.html > > I hope this helps > Lukas > > On Mon, Dec 24, 2018 at 5:28 AM Max Kremer > wrote: > >> Hi, >> >> Co

Re: Fetching a result set into a TYPE and providing addition information

2018-12-24 Thread Max Kremer
Thanks Daniel. This makes sense of course, however if I use plain old map I have to handle populating the fields of the pojo, something fetchInto takes care of. I want to have my cake and eat it too ;) On Mon, Dec 24, 2018, 3:26 AM Daniele Antonini Hi, > > My 2 cents: fetchInto() is a

Fetching a result set into a TYPE and providing addition information

2018-12-23 Thread Max Kremer
Hi, Consider the following typical query execution. I am populating a JPA annotated POJO called MyRow d.select( ..) .from( ... ).as("S") .where( ... ) .groupBy(groupByFields) .fetchInto(MyRow.class); What I

Re: Feature Request: startWith and endsWith Conditions should have ignoreCase version

2018-09-26 Thread Max Kremer
Lukas, completely argee. Only bringing it up because there are already similar methods... Regards, Max Kremer http://www.trialfire.com email: m...@trialfire.com twitter: @maxtrialfire skype: maxkremer ᐧ On Wed, Sep 26, 2018 at 3:45 AM Lukas Eder wrote: > Hi Max, > &g

Re: Feature Request: startWith and endsWith Conditions should have ignoreCase version

2018-09-25 Thread Max Kremer
by > using LOWER() yourself in your own code. > > Thanks again for the pointers, > Lukas > > On Fri, Sep 21, 2018 at 5:38 PM Max Kremer > wrote: > >> Sorry one more : https://postgrespro.com/docs/postgresql/10/collation >> >> Relevant text : ''Note tha

Re: Feature Request: startWith and endsWith Conditions should have ignoreCase version

2018-09-21 Thread Max Kremer
Sorry one more : https://postgrespro.com/docs/postgresql/10/collation Relevant text : ''Note that while this system allows creating collations that “ignore case” or “ignore accents” or similar (using the ks key), PostgreSQL does not at the moment allow such collations to act in a truly case-

Re: Feature Request: startWith and endsWith Conditions should have ignoreCase version

2018-09-21 Thread Max Kremer
Support material: https://dba.stackexchange.com/questions/191905/does-postgresql-support-icu-collations-options-and-settings On Friday, September 21, 2018 at 11:31:39 AM UTC-4, Max Kremer wrote: > > Hi Lukas, > > >I'm not sure how COLLATE will solve this issue on Pos

Re: Feature Request: startWith and endsWith Conditions should have ignoreCase version

2018-09-21 Thread Max Kremer
ide the case-insensitivity > feature of these methods to use collations instead of LOWER(): > https://github.com/jOOQ/jOOQ/issues/7881 > > So, here's your feature request, due for jOOQ 3.12: > https://github.com/jOOQ/jOOQ/issues/7882 > > Thanks, > Lukas > > On Thu, Sep 20,

ignoreCase versions of startsWith and endsWith

2018-09-20 Thread Max Kremer
Hello again Lukas! I noticed the *contains* and *equals* have *ignoreCase* analogues. It would be great if Field.startWith and Field.endsWith also had versions that ignored case. Pretty simple request this time :) Thanks, Max -- You received this message because you are subscribed to the

Feature Request: startWith and endsWith Conditions should have ignoreCase version

2018-09-20 Thread Max Kremer
Hello again Lukas! I noticed the contains and equals and ignoreCase analogues. It would be great if Field.startWith and Field.endsWith also had versions that ignored case. Pretty simple request this time :) Thanks, Max -- You received this message because you are subscribed to the Google

Re: Does JOOQ support GROUP BY column number?

2018-01-24 Thread Max Kremer
> which doesn't work). But you can still do it by passing DSL.inline(index) > to the GROUP BY clause. > > 2018-01-23 23:33 GMT+01:00 Max Kremer <mkr...@trialfire.com > > : >> >> Yes I know why this may be bad practice etc. etc But I'd like to know >> if it

Does JOOQ support GROUP BY column number?

2018-01-23 Thread Max Kremer
In SQL you can do this SELECT col1, col2, col3FROM my_tableORDER BY 1 Essential referring to a column by its number/ordinal position within the select. Can I do this with JOOQ? Yes I know why this may be bad practice etc. etc But I'd like to know if it's possible. -- You received

Re: Record.get and Postgres array type

2017-09-06 Thread Max Kremer
Ok I think I know what's going on. The issue is our cache implementation. When caching is not part of the equation the array stuff works fine. We use the MockDataProvider with REDIS to do out cache (I'm sure you recall this technique and associated blog post). Anyway, there may be a bug in the

Re: Record.get and Postgres array type

2017-09-06 Thread Max Kremer
Also tried this: String[] foo = r.get(field("distinctpath", SQLDataType.VARCHAR. getArrayDataType())); No luck. Still getting a class cast exception *[ClassCastException: java.lang.String cannot be cast to [Ljava.lang.String;]* On Wednesday, September 6, 2017 at 10:35:05 AM UTC-4,

Re: Record.get and Postgres array type

2017-09-06 Thread Max Kremer
r > your query? What's the DDL of sometable? > > Cheers, > Lukas > > 2017-09-06 0:12 GMT+02:00 Max Kremer <mkr...@trialfire.com >: > >> Hi, >> >> I have a SQL result set that includes a varchar array as one of the >> columns. I'm mapping over the Res

Record.get and Postgres array type

2017-09-05 Thread Max Kremer
Hi, I have a SQL result set that includes a varchar array as one of the columns. I'm mapping over the Result returned by fetch() and manually populating a pojo but I'm having trouble populating the String[] array field of the pojo. d.fetch("select array_agg(some_field) as theArray from

Re: Insert into + select from using a string based sub-query and a TableImpl

2017-03-24 Thread Max Kremer
done. > > Hope this helps, > Lukas > > 2017-03-24 22:02 GMT+01:00 Max Kremer <mkr...@trialfire.com > > : > >> Hi, >> >>What I'm trying to accomplish is to build a simple INSERT INTO () >> SELECT ... FROM type query. >> >> The

Re: [REQUEST FOR FEEDBACK]: What small but incredibly useful utility are you missing the most in jOOQ?

2016-12-08 Thread Max Kremer
iefly illustrates the use-case with 1 paragraph, and then provides > links to more details. > > I've created this issue to fix this: > https://github.com/jOOQ/jOOQ/issues/5669 > > Hope that responds to your suggestion? :) > > 2016-11-14 16:46 GMT+01:00 Max Kremer <mkr...@tr

Re: [REQUEST FOR FEEDBACK]: What small but incredibly useful utility are you missing the most in jOOQ?

2016-11-14 Thread Max Kremer
well > enough from the manual. > > What do you mean by "example use-cases"? You mean concrete examples > involving business use-cases like ETL, reporting, complex predicate logic? > > 2016-11-10 23:47 GMT+01:00 Max Kremer <mkr...@trialfire.com > > : > >>

Re: [REQUEST FOR FEEDBACK]: What small but incredibly useful utility are you missing the most in jOOQ?

2016-11-10 Thread Max Kremer
rt of jOOQ having its learning curve? Is there > anything that you can still recall now, after 2.5 years, that you think > could be improved for new users? Can the "JOOQ Way" of doing things be > conveyed more easily? > > Cheers, > Lukas > > 2016-10-28 21:06 GMT+0

Re: [REQUEST FOR FEEDBACK]: What small but incredibly useful utility are you missing the most in jOOQ?

2016-10-28 Thread Max Kremer
I just have to say that JOOQ is AWESOME! We've been using it for about 2.5 years now and it's really a joy to work with. Its a big library and has its learning curve but it crushes every ORM (or any other lib that wraps JDBC) out there. Once you get the "JOOQ Way" of doing things it makes for

Support for Postgresql ESCAPE keyword for use with LIKE

2016-10-28 Thread Max Kremer
Postgres supports setting an escape character as part of the query when using the LIKE predicate. Is there any support for this in JOOQ? >From the docs: https://www.postgresql.org/docs/9.5/static/functions-matching.html string LIKE pattern [ESCAPE escape-character] -- You received this

Re: Strange result using decode()

2016-02-17 Thread Max Kremer
ified PostgreSQL 8.0 version). We do > provide commercial support for the Amazon Redshift database to take into > account these subtle differences. > > Best Regards, > Lukas > > 2016-02-14 1:42 GMT+01:00 Max Kremer <mkr...@trialfire.com >: > >> Hi, >> >&

Strange result using decode()

2016-02-13 Thread Max Kremer
Hi, Trying to get a simple CASE expression in my SELECT statement I want the following: select case some_bool when true then 'true' else 'false' end My java looks like: DSL.decode().value(someBool).when(Boolean.FALSE, "true").otherwise("false"); But the SQL it

Re: Stylistic question on building queries with conditional components and still being fluent

2016-01-14 Thread Max Kremer
use = tenantSql.jooqTable( joinables.get(0), requiresView( joinables.get(0), query)); //Build the joining by looking up tuples in the join clause map. for (int i = 1; i < joinables.size(); i++){ fromClause = joinClauses.get( new Tuple<Entity, Entity>(joinables.get(i-1 ), joinables.get(i)))

Re: How to set postgresql query runtime params ?

2015-12-04 Thread Max Kremer
ction(new PostgresParamListener(), (c, d) -> { ...d.select( }); On Friday, December 4, 2015 at 3:08:45 AM UTC-5, Lukas Eder wrote: > > Hi Max, > > 2015-12-03 23:44 GMT+01:00 Max Kremer <mkr...@trialfire.com > > : > >> Hi Lukas, >> >> Thanks for the tips. I

Re: How to set postgresql query runtime params ?

2015-12-04 Thread Max Kremer
mListener())) )); }); } On Friday, December 4, 2015 at 3:08:45 AM UTC-5, Lukas Eder wrote: > > Hi Max, > > 2015-12-03 23:44 GMT+01:00 Max Kremer <mkr...@trialfire.com > > : > >> Hi Lukas, >> >> Thanks for the tips. I played around with pu

Re: How to set postgresql query runtime params ?

2015-12-03 Thread Max Kremer
return db.withConnection(c -> { return block.apply(c, DSL.using(c, SQLDialect.POSTGRES_9_4, settings)); }); } . On Thursday, December 3, 2015 at 3:55:52 AM UTC-5, Lukas Eder wrote: > > > > 2015-12-02 18:59 GMT+01:00 Max Kremer <mkr...@trialfire.com >

Re: How to set postgresql query runtime params ?

2015-12-02 Thread Max Kremer
().execute("RESET enable_sort"); } catch (SQLException e) { e.printStackTrace(); } } } On Wednesday, December 2, 2015 at 11:43:52 AM UTC-5, Max Kremer wrote: > > Hi Lukas, > > I need to be able to run the statements ad-hoc. What I mean by that is I > need them fo

Re: How to set postgresql query runtime params ?

2015-12-02 Thread Max Kremer
fecycle and run the statements at the beginning and at > the end of a transaction. > > When do you want to run the statements? > > 2015-12-01 20:31 GMT+01:00 Max Kremer <mkr...@trialfire.com > > : > >> >> >> In PostGres (as well other DBs I've used) you ca

Re: How to set postgresql query runtime params ?

2015-12-02 Thread Max Kremer
t? On Wednesday, December 2, 2015 at 11:43:52 AM UTC-5, Max Kremer wrote: > > Hi Lukas, > > I need to be able to run the statements ad-hoc. What I mean by that is I > need them for some queries and not others, it's not something I want to > universally apply across all conne

How to set postgresql query runtime params ?

2015-12-01 Thread Max Kremer
In PostGres (as well other DBs I've used) you can set runtime params that affect the query and/or result. This is accomplished with the use of SET and RESET as described here SET search_path TO my_schema, public SELECT * from foo

Re: Possible bug in JOOQ's data record to column mapping functionality

2015-11-10 Thread Max Kremer
thing not working may just be case sensitivity (this wouldn't be an > issue with the field(name("P", "foo")) method) > - jOOQ doesn't have a toStream() method. I suspect this is just a typo, > not some implementation of your own? > > Cheers, > Lukas > > 2

Possible bug in JOOQ's data record to column mapping functionality

2015-11-09 Thread Max Kremer
I recently ran into a strange issue around retrieving data from a JOOQ record. I wanted to post it here before logging a bug officially in GitHub. The issue is basically an inconsistency around how you need to access the result of a select depending on how that query is executed. The following

Re: Using arbitrary SQL string as a CTE in conjunction with the DSL

2015-11-06 Thread Max Kremer
plement to >>> enable these features. >>> >>> One workaround I can think of right now is for you to implement a >>> reflection proxy that implements org.jooq.Select and delegates all calls to >>> a backing plain SQL ResultQuery. It doesn't soun

Re: Using arbitrary SQL string as a CTE in conjunction with the DSL

2015-11-06 Thread Max Kremer
obust > workaround, though. > > Another option is not to use a CTE, but a derived table, where plain SQL > is perfectly possible. > > Finally, if you externalise the CTE into a view, you can re-use the SQL > string even more easily. > > I hope this helps, > Lukas >

Using arbitrary SQL string as a CTE in conjunction with the DSL

2015-11-05 Thread Max Kremer
Hello fellow JOOQers I have a need to mix raw SQL strings with SQL generated by the DSL. I have a CTE which is far too cumbersome to express in jooq - for the sake of simplicity however lets say my cte is SELECT foo FROM bar I would like to do something like this String myCte = "SELECT foo

Re: Suppress casting when inserting a null into a column in Postgresql

2015-08-21 Thread Max Kremer
could use plain SQL: DSL.field(?, value) I hope this helps, Lukas 2015-08-18 23:30 GMT+02:00 Max Kremer mkr...@trialfire.com javascript: : Hello fellow JOOQers I'm having an issue where the SQL being generated fails to execute because of type conversion. I have table with two columns

Suppress casting when inserting a null into a column in Postgresql

2015-08-18 Thread Max Kremer
Hello fellow JOOQers I'm having an issue where the SQL being generated fails to execute because of type conversion. I have table with two columns A, B which are NUMERIC CREATE TABLE my_table ( id pk, A numeric(6,3), B numeric(6,4) ) I'm building my SQL query like this

Re: Binding a value in an interval literal [postgreSQL 8]

2015-08-17 Thread Max Kremer
Awesome! Thank you!!! -- You received this message because you are subscribed to the Google Groups jOOQ User Group group. To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscr...@googlegroups.com. For more options, visit

Binding a value in an interval literal [postgreSQL 8]

2015-08-07 Thread Max Kremer
Hello fellow Jooqers I'm having trouble creating an interval in my JOOQ query. Here is what I'm trying to do, I have a bunch of records with timestamps and I want the ones created in the last *n *days. Here is the SQL to illustrate SELECT * FROM stuff WHERE timestamp = NOW() - INTERVAL '20