<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>