1. get values with max id forum.hibernate.orghi all, I'm trying to retrieve of some hotels from the database with max(id). say the table is as follows: Id Hotel Year Month values 1 3 2010 5 8 2 2 2010 6 10 3 4 2011 8 20 4 3 2011 3 16 5 1 2011 4 15 6 4 2011 8 23 7 3 2011 3 31 So ... |
2. Inert into User (name, pass, id) values (?, password(?), id) forum.hibernate.orgI'm a newbee of Hibernate.. I create the User Table. ----------------------------------------------------- create table User ( name char(8) not null, pass char(30) not null, id char(8) not null, primary key(id) ); ----------------------------------------------------- Persistent Object is the following. ----------------------------------------------------- public User { private name, pass,id; public String getName(){}; public String getPass(){}; public String getId(){}; public void setName(String name){}; public void setPass(String pass){}; public ... |
3. howto use id_value for unsaved-value forum.hibernate.org |
4. usage of unsaved-value="ID_VALUE"? forum.hibernate.orgHi I try to use unsaved-value="id_value" and it gives the error below? any ideas? P.S the mapping is included below Mapping spec from the manual |
5. unsaved-value of an assigned id forum.hibernate.orgI think I really have problems in understanding the usage of unsaved-value. class X ... id .... unsaved-value = "any/none/null.." generator = "assigned" class Y id ... unsaved-value = "null" generator = "sequence" many-to-one = x cascade= "save-update" I really have doubts to solve the unsaved-value problem for the assigned id. if I used the generator = " sequence" for X ... |
6. Start value for ID generation forum.hibernate.orgmichael wrote: I think there is a way to specify the autoincrement start value when creating the table ... check the mysql manual Thanks, yes that should work. In our case though we're relying on hibernate's schema export function. Yes, could easily switch to using scripts but then there's one more thing to maintain whenever there's a schema change (though once ... |
7. Wrong value of ID forum.hibernate.orgI used Hibernate a wile and had no problem, but yesterday I was trying to do what I always do, nothing fancy but I'm getting a wrong value for ID. I have primitive class and mapping: Code: public class ServerUser{ private Long id; private Long creater; private Date created; ... |
8. @Id and its unsaved-value forum.hibernate.orgI am having problems with @Id and its unsaved-value. I would like the unsaved-value to default to something without an instance being created. But the code in UnsavedValueFactory.getUnsavedIdentifierValue seems to choose to try to instantiate an instance before it checks whether the @Id is of a primitive type: Code: if ( unsavedValue == null ) ... |
10. Why ignore value of id? forum.hibernate.org |
11. Generating a value which depends on id forum.hibernate.orgHello, I came upon an interesting problem: I have a table, which has an id and depends_on_id columns. depends_on_id is constrained not to contain null values, and I map a class SomeClass to it. I use org.hibernate.id.enhanced.TableGenerator to generate the ids. The caveat is that the value of depends_on_id depends on the id generated - that is I need to know ... |
12. id unsaved-value strategy UNDEFINED forum.hibernate.orgHello, In debug mod of the server I found a bug during the "saveOrUpdate" of an object Ventilation. The printed trace is "id unsaved-value strategy UNDEFINED". I manage to saveOrUpdate others objects but the mapping of their id was simple. I thing that the problem com from the mapping of the id of Ventilation. ====================== Mon fichier de mapping: -------------------------- Code: ... |