my models are :
Code:
package com.bedkaco.portlets.teacher.model;
// Generated Oct 11, 2010 4:28:33 PM by Hibernate Tools 3.2.4.GA
import javax.persistence.*;
/**
* SPRStudent generated by hbm2java
*/
@Entity
@Table(name = "teacher", schema = "public")
public class Teacher implements java.io.Serializable {
private long teachid;
private String fistname;
private String lastname;
private String rate;
public Teacher() {
}
@Id
@Column(name = "teachid", unique = true, nullable = false)
public long getTeachid() {
return teachid;
}
public void setTeachid(long teachid) {
this.teachid = teachid;
}
@Column(name = "firstname", length = 150)
public String getFistname() {
return fistname;
}
public void setFistname(String fistname) {
this.fistname = fistname;
}
@Column(name = "lastname", length = 150)
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
@Column(name = "rate", length = 150)
public String getRate() {
return rate;
}
public void setRate(String rate) {
this.rate = rate;
}
}
AND
Code:
package com.bedkaco.portlets.user_account.model;
// Generated Oct 17, 2010 11:34:51 AM by Hibernate Tools 3.2.4.GA
import com.bedkaco.portlets.group.model.Group;
import com.bedkaco.portlets.major.model.Major;
import com.bedkaco.portlets.system_log.model.SystemLog;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
/**
* UserAccount generated by hbm2java
*/
@Entity
@Table(name = "user_account", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = "username"))
public class UserAccount implements java.io.Serializable {
private long id;
private Group group;
private Major major;
private String address;
private String codemeli;
private String email;
private int enabled;
private String fathername;
private String firstname;
private String lastname;
private String mobile;
private String passwordHash;
private String phone;
private String post;
private String roleid;
private String sex;
private Long stno;
private String username;
private List<SystemLog> systemLogs = new ArrayList<SystemLog>(0);
@OneToMany(fetch = FetchType.LAZY, mappedBy = "userAccount")
public List<SystemLog> getSystemLogs() {
return systemLogs;
}
public void setSystemLogs(List<SystemLog> systemLogs) {
this.systemLogs = systemLogs;
}
public UserAccount() {
}
public UserAccount(long id, int enabled, String firstname, String lastname,
String username) {
this.id = id;
this.enabled = enabled;
this.firstname = firstname;
this.lastname = lastname;
this.username = username;
}
public UserAccount(long id, Group group, Major major, String address,
String codemeli, String email, int enabled, String fathername,
String firstname, String lastname, String mobile,
String passwordHash, String phone, String post, String roleid,
String sex, Long stno, String username) {
this.id = id;
this.group = group;
this.major = major;
this.address = address;
this.codemeli = codemeli;
this.email = email;
this.enabled = enabled;
this.fathername = fathername;
this.firstname = firstname;
this.lastname = lastname;
this.mobile = mobile;
this.passwordHash = passwordHash;
this.phone = phone;
this.post = post;
this.roleid = roleid;
this.sex = sex;
this.stno = stno;
this.username = username;
}
@Id
@Column(name = "id", unique = true, nullable = false)
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "groupcode")
public Group getGroup() {
return this.group;
}
public void setGroup(Group group) {
this.group = group;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "reshtecode")
public Major getMajor() {
return this.major;
}
public void setMajor(Major major) {
this.major = major;
}
@Column(name = "address", length = 250)
@Length(max = 250)
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
@Column(name = "codemeli", length = 50)
@Length(max = 50)
public String getCodemeli() {
return this.codemeli;
}
public void setCodemeli(String codemeli) {
this.codemeli = codemeli;
}
@Column(name = "email", length = 1000)
@Length(max = 100)
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
@Column(name = "enabled", nullable = false)
public int getEnabled() {
return this.enabled;
}
public void setEnabled(int enabled) {
this.enabled = enabled;
}
@Column(name = "fathername", length = 50)
@Length(max = 50)
public String getFathername() {
return this.fathername;
}
public void setFathername(String fathername) {
this.fathername = fathername;
}
@Column(name = "firstname", nullable = false, length = 50)
@NotNull
@Length(max = 50)
public String getFirstname() {
return this.firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
@Column(name = "lastname", nullable = false, length = 50)
@NotNull
@Length(max = 50)
public String getLastname() {
return this.lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
@Column(name = "mobile", length = 50)
@Length(max = 50)
public String getMobile() {
return this.mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
@Column(name = "password_hash")
public String getPasswordHash() {
return this.passwordHash;
}
public void setPasswordHash(String passwordHash) {
this.passwordHash = passwordHash;
}
@Column(name = "phone", length = 50)
@Length(max = 50)
public String getPhone() {
return this.phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
@Column(name = "post", length = 1000)
@Length(max = 100)
public String getPost() {
return this.post;
}
public void setPost(String post) {
this.post = post;
}
@Column(name = "roleid", length = 50)
@Length(max = 50)
public String getRoleid() {
return this.roleid;
}
public void setRoleid(String roleid) {
this.roleid = roleid;
}
@Column(name = "sex")
public String getSex() {
return this.sex;
}
public void setSex(String sex) {
this.sex = sex;
}
@Column(name = "stno")
public Long getStno() {
return this.stno;
}
public void setStno(Long stno) {
this.stno = stno;
}
@Column(name = "username", unique = true, nullable = false)
@NotNull
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
}
please help :| :-s