CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Java >  框架、开源

我用JAVA写了类,用XDOCLET映射成HIBERNATE的配置文件,再生成TABLE.可是在生成表是报错,不知道为什么?

楼主walksea(落月)2006-05-02 17:14:15 在 Java / 框架、开源 提问

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

相关问题

关键词

得分解答快速导航

  • 帖主:walksea

相关链接

  • CSDN Java频道
  • Java类图书
  • Java类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo