|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
ORM/Hibernate generator issue
I've finally been playing around with ORM lately and I've hit an issue thatBobby Hartsfield 12/03/11 10:10 P Try setting generator="native" instead.Matt Quackenbush 12/03/11 10:15 P Thanks Matt. I swear I did try that earlier but I just tried it again toBobby Hartsfield 12/03/11 10:23 P I've finally been playing around with ORM lately and I've hit an issue that I'm having a hard time finding answers for on Google. Hopefully someone here knows what the deal. Below is a very basic "person" app with one component (outside of app.cfc) and a small index.cfm The error I'm seeing is: this id generator generates long, integer, short Root cause :org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short Basically, I read a xls doc of first and last names and (attempt to) load it into a tblPeople table. The above error happens in inde.cfm when entitySave(obj) is triggered. I can comment out " entitySave(obj);" and not get any errors. There are only about 3000 records in people.xls and tblPeople doesn't exist yet. It is a new, basic install of CF9 on server 2003. This worked earlier but I was using the old style <cfcomponent /> tags in person.cfc hopefully I'm just missing something obvious to someone else. Any help appreciated here. Thanks ---INDEX.CFM <cfset ormReload() /> <cfspreadsheet action="read" src="#expandPath('.')#\people.xls" query="sheet" headerrow="1" /> <cfloop query="sheet" startrow="2"> <cfscript> obj = EntityNew("person"); obj.setPersonFname(sheet["personFname"][sheet.currentRow]); obj.setPersonLname(sheet["personLname"][sheet.currentRow]); entitySave(obj); </cfscript> </cfloop> ---PERSON.CFC component persistent="true" table="tblpeople" { property name="personId" fieldtype="id" generator="increment"; property name="personFname"; property name="personLname"; } ---APPLICATION.CFC component { this.name = "personTest"; this.ormenabled = "true"; this.datasource = "peopleTest"; this.ormsettings={dbcreate="update", logsql="true"}; this.ormsettings.savemapping = false; this.clientmanagement="false"; this.sessionmanagement="true"; this.sessiontimeout="#createtimespan(0,0,1,0)#"; this.applicationtimeout="#createtimespan(0,0,1,0)#"; } .:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com Try setting generator="native" instead. On Dec 3, 2011 9:10 PM, "Bobby Hartsfield" <bobby@acoderslife.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- Thanks Matt. I swear I did try that earlier but I just tried it again to make sure I didn't typo it or something earlier and it got past the error. Today has been one long caching nightmare. Thanks! .:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com Try setting generator="native" instead. On Dec 3, 2011 9:10 PM, "Bobby Hartsfield" <bobby@acoderslife.com> wrote: > > I've finally been playing around with ORM lately and I've hit an issue that ----- Excess quoted text cut - see Original Post for more ----- exist ----- Excess quoted text cut - see Original Post for more -----
|
May 24, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||