Mercurial > lada > lada-server
changeset 392:9d5e4d4eb90f
Added method to persist database objects.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 05 Dec 2013 09:54:19 +0100 |
parents | f0671f400c2d |
children | ab0307eccee8 |
files | src/main/java/de/intevation/lada/manage/DataManager.java src/main/java/de/intevation/lada/manage/Manager.java |
diffstat | 2 files changed, 18 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/manage/DataManager.java Tue Dec 03 17:27:36 2013 +0100 +++ b/src/main/java/de/intevation/lada/manage/DataManager.java Thu Dec 05 09:54:19 2013 +0100 @@ -38,10 +38,23 @@ EJBTransactionRolledbackException, TransactionRequiredException { em.merge(object); - //em.persist(object); } /** + * Persist a database object. + * + * @param object The new object. + */ + @Override + @TransactionAttribute(TransactionAttributeType.REQUIRED) + public void persist(Object object) + throws EntityExistsException, + IllegalArgumentException, + EJBTransactionRolledbackException, + TransactionRequiredException { + em.persist(object); + } + /** * Update a database object. * * @param object The object to update.
--- a/src/main/java/de/intevation/lada/manage/Manager.java Tue Dec 03 17:27:36 2013 +0100 +++ b/src/main/java/de/intevation/lada/manage/Manager.java Thu Dec 05 09:54:19 2013 +0100 @@ -31,4 +31,8 @@ public void delete(Object object) throws IllegalArgumentException, TransactionRequiredException; + + void persist(Object object) throws EntityExistsException, + IllegalArgumentException, EJBTransactionRolledbackException, + TransactionRequiredException; }