I have a table for class UserStatus ( userId varchar, statusId bigint). Set statusId to autoincrement and specify userId as primary key for some optimisation because most request goes with userId. Using Eclipse. After reverse engineering receive such file:
<class name="xxx.UserStatus" table="user_statuses"
catalog="xxx">
<id name="userId" type="java.lang.Long">
<column name="UserId" />
<generator class="identity" />
</id>
<property name="statusId" type="long">
<column name="StatusId" not-null="true" unique="true" />
</property>
<property name="status" type="string">
<column name="Status" length="256" not-null="true" />
</property>
<property name="updateTime" type="timestamp">
<column name="UpdateTime" length="19" not-null="true" />
</property>
</class>
but it's not what i want cos statusId is must database generated. StatusId must be autogenerated.
Any solution?