...
Expand | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||
|
To create your database tables, you can follow this how-to guide.
Creating the Data Object Classes
All data objects should be placed under com.crm.dataobject.* named packages, extend either com.crm.dataobject.CRMDO or one of its subclasses and follow this naming convention: CRMDO<entityname>.java.
...
Note that id, name, altCode, description, createdByUser, updatedByUser, createdByUnit, updatedByUnit, createdDate, updatedDate, isDeleted and recVersion properties are inherited from com.crm.dataobject.CRMDO super class.
Mapping the Data Object Classes
Hibernate is used by CRM.COM to map a defined class to a database table and its properties to the table's fields.
Creating Hibernate Mapping Files
Hibernate Mapping files should always have the following format: <classname>.hbm.xml
...
<id> and <version> elements are used to map the primary key and the version properties of the java class. Through the version property, Hibernate can provide optimistic locking.
Hibernate Configuration File
Hibernate Configuration file (hibernate.cfg.xml) is used for defining all the hibernate mapping files. During the application's initialization process, hibernate reads this configuration file and maps the classes defined, to the database tables.
...
To continue implementing the model layer, go to Developing the Business Objects