Package org.openxava.calculators
Class IdentityCalculator
- java.lang.Object
-
- org.openxava.calculators.IdentityCalculator
-
- All Implemented Interfaces:
java.io.Serializable
,ICalculator
,IHibernateIdGeneratorCalculator
public class IdentityCalculator extends java.lang.Object implements IHibernateIdGeneratorCalculator
To use identity database id generation.An example of use:
<property name="id" key="true" type="int" hidden="true"> <default-value-calculator class="org.openxava.calculators.IdentityCalculator" on-create="true"/> </property>
It does not work with EJB2. It works with Hibernate and EJB3 JPA.- Author:
- Javier Paniza
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IdentityCalculator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
calculate()
java.lang.String
hbmGeneratorCode()
Returns the xml code to insert inside 'id' element in .hbml file.
-
-
-
Method Detail
-
hbmGeneratorCode
public java.lang.String hbmGeneratorCode()
Description copied from interface:IHibernateIdGeneratorCalculator
Returns the xml code to insert inside 'id' element in .hbml file.- Specified by:
hbmGeneratorCode
in interfaceIHibernateIdGeneratorCalculator
-
calculate
public java.lang.Object calculate() throws java.lang.Exception
- Specified by:
calculate
in interfaceICalculator
- Throws:
java.lang.Exception
-
-