Possible hibernate bug

I’ve been working on porting one of our systems to Lucee and Postgres that
makes heavy use of ORM. Ran in to one situation that I can’t quite figure
out.

The entity (“Package”) is mapped to a table (“package”) with a serial
datatype in the identity column (“packageID”).

On insert, Hibernate attempts to pull out the latest generated id by
querying:

select currval(’“package”_packageID_seq’)

Which, predictably, bombs. The escape chars around package should not be
there.

select currval(‘package_packageID_seq’) is what should be run.

I’m stumped as to what to tweak to make this work short of renaming the
table to something that doesn’t require escaping. I’d really like to not
have to rewrite all of the reporting that taps that table.

Any suggestions?

Steve, How are you mapping that property. The following should work (which is how I map all serial id’s):

property name=“packageId” column=“id” fieldtype=“id” generator=“sequence” params="{sequence=‘package_packageId_seq’}" ormtype=“integer” sqltype=“serial”;On December 30, 2015 at 10:15:15 AM, Steve Rittler (@Steve_Rittler) wrote:

I’ve been working on porting one of our systems to Lucee and Postgres that makes heavy use of ORM. Ran in to one situation that I can’t quite figure out.

The entity (“Package”) is mapped to a table (“package”) with a serial datatype in the identity column (“packageID”).

On insert, Hibernate attempts to pull out the latest generated id by querying:

select currval(’“package”_packageID_seq’)

Which, predictably, bombs. The escape chars around package should not be there.

select currval(‘package_packageID_seq’) is what should be run.

I’m stumped as to what to tweak to make this work short of renaming the table to something that doesn’t require escaping. I’d really like to not have to rewrite all of the reporting that taps that table.

Any suggestions?


Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/c402dbda-9c3d-4ae4-917b-cd6d3ec05414%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I owe you a debt of gratitude. Thank you!

Not a Hibernate bug - clearly simply a gap in my understanding of how
Postgres and Hibernate work together. I’ve never used the params attribute
before but that makes a ton of sense now that I see it.

Now I know - and that’s going to make a heck of a difference. Thanks again!

steveOn Wednesday, December 30, 2015 at 1:05:28 PM UTC-5, Jon Clausen wrote:

Oops, that should use your naming conventions:

property name=“packageId” column=“packageId" fieldtype=“id” generator=“sequence” params="{sequence=‘package_packageId_seq’}" ormtype=“integer” sqltype=“serial”;

On December 30, 2015 at 1:04:20 PM, Jon Clausen (jon_c...@silowebworks.com <javascript:>) wrote:

property name=“packageId” column=“id” fieldtype=“id” generator=“sequence” params="{sequence=‘package_packageId_seq’}" ormtype=“integer” sqltype=“serial”;