Hibernate - Annotation String as Id (Primary Key)
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
/**
* User Pending approvals
*
*/
@Entity
@Table
public class UserApproval implements Serializable {
private String username;
private String pendingApprovals ;
@Id
@GenericGenerator(name = "idGenerator", strategy = "assigned")
@GeneratedValue(generator = "idGenerator")
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPendingApprovals() {
return pendingApprovals;
}
public void setPendingApprovals(String pendingApprovals) {
this.pendingApprovals = pendingApprovals;
}
}