Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleBANKBRANCHES table


Column NameData TypeDescription
BANKBRANCHIDvarchar(32)The primary key.
BANKIDvarchar(32)The related bank. Foreign Key to BANKS table.
BANKBRANCHNAMEvarchar(256)The bank branch name.
BANKBRANCHALTCODEvarchar(32)The bank branch alternative code.
BANKBRANCHDESCvarchar(512)The bank branch description.
BANKBRANCHDELETEDintegerThe deleted flag. Note that records are not physically deleted but marked as deleted.
RECVERSIONintegerThe record version number. This number is increased every time the record is updated.
BANKBRANCHCREATEDBYUSERIDvarchar(32)The user that created the record. Foreign key to USERS table.
BANKBRANCHUPDATEDBYUSERIDvarchar(32)The user that updated the record. Foreign key to USERS table.
BANKBRANCHCREATEDBYOUUIDvarchar(32)The user's unit that created the record. Foreign key to OUUNITS table.
BANKBRANCHUPDATEDBYOUUIDvarchar(32)The user's unit that updated the record. Foreign key to OUUNITS table.
BANKBRANCHCREATEDDATEtimestampThe date the record was created.
BANKBRANCHUPDATEDDATEtimestampThe date the record was updated.



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