From: youjun g. <you...@ya...> - 2009-12-23 20:07:02
|
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 |