【】【】【】紧急,求救了,拜托了,hibernate如何配置字段长度 我只有这么多分了,拜托了

etracer 2014-04-07 09:26:45
出现如下出错误,是说主键太长,可是hibernate如何设置我不知道,请指点
[ERROR] SchemaExport - Unsuccessful: create table employee_monthPay (employee_key varchar(255) not null, month_key varchar(255) not null, primary key (employee_key, month_key))
[ERROR] SchemaExport - Specified key was too long; max key length is 1000 bytes
[ERROR] SchemaExport - Unsuccessful: alter table employee_monthPay add constraint FK970BF4799900AD4E foreign key (employee_key) references employee
[ERROR] SchemaExport - Table 'mnettest.employee_monthpay' doesn't exist
[ERROR] SchemaExport - Unsuccessful: alter table employee_monthPay add constraint FK970BF479B28BB020 foreign key (month_key) references month_pay
[ERROR] SchemaExport - Table 'mnettest.employee_monthpay' doesn't exist
是不是我修改键值得长度就可以解决呢?
谢谢了先

<class name="Employee" table="employee">
<id name="id" type="string" column="employee_key">
<generator class="uuid.hex"/>
</id>
<property name="no" column="no"/>
<property name="password" column="password"/>
<property name="level" column="level"/>

<component name="employeeInfo" class="EmployeeInfo">
<property name="name" column="name"/>
<property name="sex" column="sex"/>
<property name="birthday" column="birthday"/>
<property name="address" column="address"/>
<property name="portableTel" column="portable_tel"/>
<property name="houseTel" column="house_tel"/>
<property name="corporationTel" column="corporation_tel"/>
<property name="email" column="email"/>
<property name="enterCompanyDate" column="enter_company_date"/>
<property name="outCompanyDate" column="out_company_date"/>
<property name="workAddress" column="work_address"/>
<property name="department" column="department"/>
<property name="position" column="position"/>
<property name="departmentTel" column="departmentTel"/>

</component>

<set name="monthWorksList" inverse="true" cascade="all">
<key column="employee_key"></key>
<one-to-many class="MonthWorkTime"/>
</set>
下面的配置是此次的问题点
<set name="monthPayList" inverse="false" cascade="all" lazy="true" table="employee_monthPay">
<key column="employee_key"></key>
<many-to-many class="MonthPay" column="month_key"></many-to-many>
</set>

</class>



<class name="MonthPay" table="month_pay">
<id name="id" type="string" column="month_pay_key">
<generator class="uuid.hex"/>
</id>

<property name="regularSalary" column="regular_salary"/>
<property name="payDate" column="pay_date"/>
<property name="areaAllowance" column="area_allowance"/>
<property name="managerAllowance" column="manager_allowance"/>
<property name="houseAllowance" column="house_allowance"/>
<property name="commutingAllowance" column="commuting_allowance"/>
<property name="weekdayOvertimeAllowance" column="weekday_overtime_allowance"/>
<property name="playdayOvertimeAllowance" column="playday_overtime_allowance"/>
<property name="businessTrip" column="business_trip"/>
<property name="workDay" column="work_day"/>
<property name="healthInsurance" column="health_insurance"/>
<property name="welfareInsurance" column="welfare_insurance"/>
<property name="employmentInsurance" column="employment_insurance"/>
<property name="incomeTax" column="income_tax"/>
<property name="advance" column="advance"/>
<property name="temporaryPayment" column="temporary_payment"/>
<property name="loanInsurance" column="loan_insurance"/>
<property name="lifeInsurance" column="life_insurance"/>
<property name="adjustment" column="adjustment"/>
<property name="deduction" column="deduction"/>
<property name="provide" column="provide"/>
下面的配置是此次的问题点
<set name="employee" inverse="true" cascade="all" lazy="true" table="employee_monthPay">
<key column="month_key"></key>
<many-to-many class="Employee" column="employee_key"></many-to-many>
</set>
...全文
733 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
乔不思 2014-04-09
  • 打赏
  • 举报
回复
,,,,,,,,,,,,,,,,,,,,, length 字段。。。结贴吧
etracer 2014-04-07
  • 打赏
  • 举报
回复
解 决 了

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧