Home VP Suite 3.3 Support Formula in ORM Attribute
Support Formula in ORM Attribute Print
User Rating: / 0
PoorBest 

In normal, attributes are mapped to database column. We support defining Formula for attribute in ORM Persistable class in order to query the database. In the generated mapping file, it will show the formula correspondingly.

Formula is a SQL expression and does not have any column for it. Now, formula can be define. You can take advantage of formula by generating ORM persistable code from the object model.

 

Defining ORM Formula

  1. Right-click on an attribute in an ORM Persistable class and select Open Specification... in the popup menu.

  2. Open the ORM Attribute Detail tab.

  3. Enter the Formula for the attribute in the Formula field.

  4. Confirm editing by pressing OK.


Generating ORM Code from Class Diagram

  1. Select Tools > Object-Relational Mapping (ORM) > Generate Code... from the main menu.

  2. Select generate Code and Database or Code only.

  3. Specify the output path of the code.

  4. When everything is ready, press OK to proceed with code generation.


Here is the generated files, with formula presented:

Hibernate Mapping File (when XML is selected as Mapping Type)

 

Java source code (when Annotation is selected as Mapping Type)

Comments (0)Add Comment

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security code
Write the displayed characters


busy
Last Updated on Thursday, 05 June 2008 08:44