Hi all,
I'm a newbie with JPA.
I need to map a search object to a table. The search object has only and id, name. The big object has more fileds id, name, adress and more.
I use this as big object view plaincopy to clipboardprint?
I use this as big object
@Entity
@Table(name="users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String name;
private String adress;
private String keywords;
}
//this is my search object
@XXX
public class UserSearch {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String name;
}
What annotations I need to use to map the search object to the table users?
I'm using spring+struts2+hibernate+JPA.
Help is appreciated! Thanks!