Sequences management

Jspresso now supports some great facilities to manage sequence for business entities :

  • Generating and incrementing sequence number, stored into database.
  • Managing database persistence together with the business entity, with guarantee of sequence number unicity.
  • Managing template to format the sequence depending on sequence number and the business object itself  (i.e for example B-EN-2017-0001).
  • New filter module UI to enter sequence templates.

 

How to manage it :

  • Prepare your project to use jspresso-extensions module.
  • Setup your business entity (for example “Company“) to extend “Sequenceable“.
  • Add a computed field “sequenceType” which returns the template to use.
    For exemple : “Company.” + getComponent().getType().getCode() + “.” + Calendar.getInstance().get(Calendar.YEAR)
  • Integrate the filter module “SequenceGenerator.module”, create a new temple matching your needs.
    For example :  C-${component.type.code}-${.now?string[“yyyy”]}-${sequenceIndex}

 

Categories: Model

Leave a Reply