Class SequenceCalculator

  • All Implemented Interfaces:, ICalculator, IHibernateIdGeneratorCalculator

    public class SequenceCalculator
    extends java.lang.Object
    implements IHibernateIdGeneratorCalculator, ICalculator
    To use sequence database id generation.

    An example of use:

      <property name="id" key="true" type="int" hidden="true">
                    <default-value-calculator class="org.openxava.calculators.SequenceCalculator" on-create="true">
                            <set property="sequence" value="XAVATEST_SIZE_ID_SEQ"/>
    It does not work with EJB2. It works with Hibernate and EJB3 JPA.
    Javier Paniza
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object calculate()  
      java.lang.String getSequence()  
      java.lang.String hbmGeneratorCode()
      Returns the xml code to insert inside 'id' element in .hbml file.
      void setSequence​(java.lang.String sequence)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SequenceCalculator

        public SequenceCalculator()
    • Method Detail

      • getSequence

        public java.lang.String getSequence()
      • setSequence

        public void setSequence​(java.lang.String sequence)
      • calculate

        public java.lang.Object calculate()
                                   throws java.lang.Exception
        Specified by:
        calculate in interface ICalculator