Helma logo
main list history

Type.properties Documentation

To store your HopObjects into a relational database system you need to define a database mapping. This is done in the type.properties files located in the persistent HopObject's prototype directory (e.g. apps/myApp/MyPrototype). The type.properties files contain no JDBC connection information, which is located in the db.properties file in the Helma installation directory.

Configuration Settings

 _db = datasourceName

The _db entry describes the database source to use for managing objects of this type. datasourcename is the connection's name defined in the db.properties, which is located in Helma’s installation directory or the application directory. The db.properties file contains information about the JDBC connections, like the JDBC driver, the connection URL and the database username and password.

 _table = tableName

The _table entry tells Helma which table to use for objects of this type within the database. To avoid problems with reserved words of SQL or your database system you should prefix your table names. (e.g. T_Story for the Story prototype’s table)

 _prototype
 _parent = localPropertyName, localProperty.parentsCollectionName, root.collectionName

The _parent entry contains a comma-separated list of properties of objects of this type to be used as parent. Objects must know their parent in order to generate correct URLs in their href() function. If a property in the list is null, Helma will look on the following one to fetch a parent object.

If an entry in the _parent item does not contain a dot, it is interpreted as an object property of the current object that acts as the object's parent. If an entry contains a dot character, the part after the dot is interpreted as a collection in the parent object in which the current object is contained. If the _parent is specified as "root", it is not interpreted as a property of the current object. Instead, the application's root object is used as parent object.

 _id = primaryKeyColumnName

The _id entry defines the column to use as primary key. Helma requires a single primary key with no other functionality.

 _children

Simple Attributes

 simpleAttributeName = tablecolumnname

Referenced Objects

 obj = object(SomeHopObject)
 obj.local
 obj.foreign 
 obj.local.X 
 obj.foreign.X 
 obj.logicalOperator 

Collections

 coll = collection(SomeHopObject)
 coll.local
 coll.foreign 
 coll.loadmode 
 coll.cachemode 
 coll.order 
 coll.filter 
 coll.filter.additionalTables 
 coll.hints 
 coll.maxSize
 coll.accessname
 coll.group 
 coll.group.order 
 coll.group.prototype

Mountpoints

 moutpointName = mountpoint(SomeTransientHopObject)