From: Hilmar L. <hl...@ne...> - 2009-12-24 02:41:39
|
Just to repeat, I'll leave choosing the better alternative to you guys, but if you choose to let hibernate assign the primary key, then all auto-increment definitions in the database need to be disabled. That's a schema change. -hilmar Sent from away On Dec 23, 2009, at 3:06 PM, youjun guo <you...@ya...> wrote: > Vladimir, > > Simply put, each class under org.cipres.treebase.domian is mapped to > a table in treebase-dev, the id generate for example in taxonlabel > class is like this: > > @AttributeOverride(name = "id", column = @Column(name = > "TAXONLABEL_ID")) > > and in its supper class which is AbstractPersistedObject: > > @Id > @GeneratedValue(strategy = GenerationType.SEQUENCE) > > This tells hibernate to use default sequence (hibernate_sequence) to > generate the id (because it did not specify any sequence name). > because right now the current value of the sequence is 14XXX so next > query it will return 14XXX + 1, they are all taken in these two > tables. Any insert to these two tables from treebase gui will fail. > > Now all the possible solution are: > > 1. Switch to native setup, it may break the code some how, and I saw > some developers reported online that hibernate native setup may not > function well on posgresql. > > 2. Restart hibernate_sequence with a larger number, make it larger > enough will prevent those problems you worry about. It will cause > some incoherent. > > 3. Explicitly assign a sequence to each domain class (a lot of work, > there are about 70 of such sequence), and treebase inherit domain > structure make it a little bit more complex. > > Youjun > > > > > > > > > --- > --- > --- > --------------------------------------------------------------------- > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast > and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Treebase-devel mailing list > Tre...@li... > https://lists.sourceforge.net/lists/listinfo/treebase-devel |