Axon Ivy's JPA Persistence Lib utility helps you accelerate process automation initiatives by introducing an abstraction DAO layer. This utility:
- Allows robust and complex database access based on the JPA 2.2 standard.
- Helps you create DAO classes for your entities with direct access to databases using standard APIs
- Simplifies the creation of typical entity classes
- Supports you with a demo implementation
- Shows example usage of some optional related technologies
- persistence-utils-demo the demo project
- persistence-utils-demo-tool tool tp generate test data for the demo project
- persistence-utils-test JUnit tests for the persistence library and the demo project
- persistence-utils-demo JUnit web test demo
Changes
- APS-224 Fix handling of empty lists or null values in enum SearchFilters
- APS-226 Fix fetching of external database to method compatible with Ivy 10 and Ivy 11
Changes
- Added missing documentation of 10.0.5
- Fixed sorting of CMS to locale aware case insensitive
Incompatibilities
- Note: This note was added to 10.0.5:
HasCmsName
is now part of the persistence utils, if you have your own, you need to replace or inherit.
Changes
- Fixed web test
Changes
- APS-206 Make forceSingleResult more general
- APS-220 Add convenience functions for search filter implementation
- New functions in GenericDAO to help implementing SearchFilters containing enumerations with CMS names.
- Access to currently built search query while predicates are built.
- APS-222 Update Logging and DB GUI in Junit tests
Incompatibilities
FilterPredicate.getSearchFilter
was renamed toFilterPredicate.getSearchEnum
FilterOrder.getSearchFilter
was renamed toFilterOrder.getSearchEnum
HasCmsName
is now part of the persistence utils, if you have your own, you need to replace or inherit.
Changes
- APS-156 Fix handling of session in CriteriaQueryContext
- APS-86 Use Instant for Auditable Entities create/update/delete
- APS-87 Rename isEnabled in ToggleableEntity
- APS-158 Refactor Type hirachy for Auditable- and ToggleableEntity
Incompatibilities
❗❗ NOTE: This update contains major changes to column names and datatypes as well as refactoring of entity and DAO structure. Please refer to the list of changes mentioned here and in the recommendations ❗❗
- Datatype of
AuditableEntity
sHeader
attributes for create/update and delete date where changed toInstant
- Attribute
expiryDate
ofToggleableEntity
has been renamed to expiry and its datatype changed toInstant
- Attribute
ToggleableEntity
s isEnabled has been renamed to enabled and its datatype changed toboolean
AuditableEntity
andToggleableEntity
are now derived fromVersionableEntity
instead ofGenericIdEntity
- To provide a version of the changed Entities with a predefined
String
id the new EntitiesAuditableIdEntity
andToggleableIdEntity
and matching DAOs have been introduced
Recommendations
- rename the expiry column to expiry unless you have customized the column names anyways. e.g. ALTER TABLE yourtable RENAME COLUMN expiryDate TO expiry.
- rename the isEnabled column to enabled unless you have customized the column names anyways. e.g. ALTER TABLE yourtable RENAME COLUMN isEnabled TO enabled.
- Make sure there are no NULL values for the enabled column in your database. The column was defined as not nullable, so only manual changes in the database should have lead to NULL values
- use
get/set...AsDate
orget/set...AsLocalDateTime
methods if you need to get converted datatypes of create/modify/delete/expiryInstant
s - Change usage of
AuditableEntity
andToggleableEntity
toAuditableIdEntity
andToggleableIdEntity
. Use matching DAOs
Changes
- Added sources to maven artifact
Incompatibilities
- None
Recommendations
- None
Changes
- APS-148 Exception during save is silently swallowed
Incompatibilities
- None
Recommendations
- forceSingleResult() was moved to higher class. In case you implemented your own version, check whether you can remove it
- some functions in AbstractDAO which returned the type Object will now return the same type as coming in. If you used them and had typecasts, they might therefore be no longer necessary
Changes
- The persistence library was moved to the marketplace and will follow the version numbering scheme there
- The JPA demo project in now directly included in the persistence utils marketplace component
Incompatibilities
- The dependency to the persistence library must be removed from projects and replaced by using the marketplace component
Changes
- APS-84 forceSingleResult() should work for any type
- APS-91 Make AbstractDAO.unproxyAndInitialize() typesafe
- APS-108 Add deleted throw() in GenericDAO.save() again
Incompatibilities
- None
Changes
- TG-1013 Persistence Library History Fix
Incompatibilities
- Changes to history
- HistoryPK.timestamp changed from String to Timestamp
- History.jsonData changed from Clob to String
- Added original bean value to AuditHandler.handleUpdate()
Changes
- TG-781 Persistence Library: Allow super types in QuerySettings
Incompatibilities
- None
Changes
- TG-871 Persistence Library: SearchFilter: Sorting does not work for fields which are not part of the result tuple
Incompatibilities
- removed function GenericDAO.isSyncableEntity()
- only if code relies on bug that sorting for unselected fields does not work
Changes
- TG-780 Persistence Library: Split into library and test
Incompatibilities
- None
Incompatibilities
- Change Group ID from com.axonivy to com.axonivy.utils
- Change Artifact ID from persistence to persistence-utils
- new entity type VersionableEntity supports optimistic locking
Incompatibilities
- if you were using GenericEntity directly and you rely on optimistic locking, then change this to VersionableEntity
This is the initial version
- Use of the AxonIvy Persistence Library
- Java Bean Validation example
- JUnit tests for persistence library and demo project
- DBUnit testdata to use in demo project and also in JUnit tests
- Quartz job to raise salaries at regular time-intervals :-)
Prepare test data maintained in an integrated excel file using DBUnit. The same test data is used in the UI and in JUnit tests.
The demo project uses the hsqldb database and drops and creates all tables when started.
You may change this to a different database but be careful tu understand and
set correctly the hibernate.hbm2ddl.auto
setting in persistence.xml
!
List, edit and delete departments. Deleting a department will be done on a logical
level using features of the AuditableEntity
.
List, edit and delete persons. Persons can be synced to Ivy Users.
In this list, a person can only see other persons of the same department. Visibility of persons is implemented directly in the PersonDAO and enforced for almost all DAO functions. Only the administrator role is allowed to see all persons.
Bean validation is used to validate person data. Validations can cause Errors (e.g. if a mandatory field is missing) or Warnings (e.g. if the Ivy username does not follow the naming convention firstname.lastname).
The list is featuring sorting and filtering of columns with a lazy data-model. This means, that sorting, filtering and paging will be done by the database with a dynamically built query.