我用JAVA写了类,用XDOCLET映射成HIBERNATE的配置文件,再生成TABLE.可是在生成表是报错,不知道为什么?
package com.tc.admin.manager;
/**
* @author walksea
* @hibernate.class
* table="popedom"
*
* @hibernate.query
* name="findAllPop"
* query="from popedom"
*
*/
public class Popedom
{
private int id; //主键
private String popId;//权限的ID
private String popName;//权限的名称
private Role role; //权限角色
/**
* @hibernate.many-to-one
* column = "role_id"
* class="com.tc.admin.manager.Role"
* not-null = "true"
* @return Returns the Role.
*/
public Role getRole() {
return role;
}
/**
* @param role
* The role to set.
*/
public void setRole(Role role) {
this.role = role;
}
/**
* @hibernate.id generator-class="native" column="id"
*/
public int getId() {
return id;
}
/**
* @param id
* The id to set.
*/
public void setId(int id) {
this.id = id;
}
/**
* @hibernate.property
* column="pop_id"
* length="2"
* not-null="true"
* @return Returns the popId.
*/
public String getPopId() {
return popId;
}
/**
* @param popId
* The popId to set.
*/
public void setPopId(String popId) {
this.popId = popId;
}
/**
* @hibernate.property
* column="pop_name"
* length="20"
* @return Returns the popName.
*/
public String getPopName() {
return popName;
}
/**
* @param popName
* The popName to set.
*/
public void setPopName(String popName) {
this.popName = popName;
}
}
package com.tc.admin.manager;
//import java.util.Set;
/**
* @author walksea
* @hibernate.class
* table="role"
*
* @hibernate.query
* name="findAllRole"
* query="from role"
*
*/
public class Role {
private int roleId; //角色
private String roleName;//角色名字
private String roleDescription;//角色描述
private Person person;//一个角色可以给多个人
/**
* @hibernate.property
* column="role_description"
* type = "text"
* @return Returns the roleName.
*/
public String getRoleDescription() {
return roleDescription;
}
/**
* @param roleDescription
* The roleDescription to set.
*/
public void setRoleDescription(String roleDescription) {
this.roleDescription = roleDescription;
}
/**
* @hibernate.id generator-class="native" column="role_id"
*/
public int getRoleId() {
return roleId;
}
/**
* @param roleId
* The roleId to set.
*/
public void setRoleId(int roleId) {
this.roleId = roleId;
}
/**
* @hibernate.property
* column="role_name"
* length="20"
* @return Returns the roleName.
*/
public String getRoleName() {
return roleName;
}
/**
* @param roleName
* The roleName to set.
*/
public void setRoleName(String roleName) {
this.roleName = roleName;
}
/**
* @hibernate.many-to-one
* column = "person_id"
* class="com.tc.admin.manager.Person"
* not-null = "true"
* @return Returns the Person.
*/
public Person getPerson() {
return person;
}
/**
* @param person
* The person to set.
*/
public void setPerson(Person person) {
this.person = person;
}
}
package com.tc.admin.manager;
/**
* @author walksea
* @hibernate.class
* table="person"
*
* @hibernate.query
* name="findAllPop"
* query="from person"
*
*/
public class Person {
private int personId;//ID
private String userName;//用户名
private String password;//密码
private String realName;//真实姓名
/**
* @hibernate.property
* column="password"
* length="32"
* not-null="true"
* @return Returns the popId.
*/
public String getPassword() {
return password;
}
/**
* @param password
* The password to set.
*/
public void setPassword(String password) {
this.password = password;
}
/**
* @hibernate.id generator-class="native" column="person_id"
*/
public int getPersonId() {
return personId;
}
/**
* @param personId
* The personId to set.
*/
public void setPersonId(int personId) {
this.personId = personId;
}
/**
* @hibernate.property
* column="real_name"
* length="20"
* @return Returns the realName.
*/
public String getRealName() {
return realName;
}
/**
* @param realName
* The realName to set.
*/
public void setRealName(String realName) {
this.realName = realName;
}
/**
* @hibernate.property
* column="user_name"
* length="40"
* @return Returns the userName.
*/
public String getUserName() {
return userName;
}
/**
* @param userName
* The userName to set.
*/
public void setUserName(String userName) {
this.userName = userName;
}
}
用前两个生成表没有问题,当加入第三个类的时候就出问题,我怎么也找不到问题.哪位老大帮帮忙?
问题点数:100、回复次数:0Top




