I am following an excellent guide for creating pojos from a mysql database using sleep mode. A guide can be found here for reference:
Create pojos with sleep mode
I get pojos that have fields that insert other objects when a foreign key is present. For example, the user has addresses. Hibernate generates something like the following:
public class User(){
private String name;
private Integer uid;
private Address address;
}
I have a problem, however, in that I want the classes to actually contain the value of the foreign key. For example, I want the User object to have a class field corresponding to the database field for addressId. So, I want the object to really look something like this:
public class User(){
private String name;
private Integer uid;
private Integer addressId;
private Address address;
}
- , , ?
Update:
SO, , : ?
, . . , , .
Update:
, . . pojos, . . , " ". , , pojo , . gson .
gson pojo , hibernate. , , , . , hibernate pojo. :