<property name = "name" type ="string"> <meta attribute ="use-in-tostring">true</meta> <column name ="name" length ="15" not-null ="true" unique ="true"> </property>//表示字段名为name长度为15不能为空具有唯一性
2'设定字段不为空,并且为这个字段设立检查约束。
<property name = "age" type ="int"> <meta attribute = "field-description">How old is the customer</meta> <meta attribute = "use-in-tostring">true</meta> <column name = "age" check ="age > 10" not-null ="true"> </property>
3'建立索引
<property name = "registeredtime" type ="timestamp"> <meta attribute ="field-description">When the customer was registered</meta> <meta attribute ="use-in-tostring">true</meta> <column name ="registerd_time" index = "idx_registerd_time" sql-type= "timestamp"> </property>
4'建立对应的字段类型
<property name = "description" type ="string"> <meta attribute ="use-in-tostring">true</meta> <column name = "description" sql-type ="text">//根据相对应的数据库来定义字段的类型 </property>