From df805ff07e7cc70dd6aa05be770d1f1b4ca6e18d Mon Sep 17 00:00:00 2001 From: Barzilai Spinak Date: Mon, 24 May 2021 19:21:56 -0300 Subject: [PATCH] Adding GLSession addJournal() --- .../src/main/java/org/jpos/gl/GLSession.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/minigl/src/main/java/org/jpos/gl/GLSession.java b/modules/minigl/src/main/java/org/jpos/gl/GLSession.java index a0aba38e2e..3a5110f772 100644 --- a/modules/minigl/src/main/java/org/jpos/gl/GLSession.java +++ b/modules/minigl/src/main/java/org/jpos/gl/GLSession.java @@ -388,6 +388,20 @@ public void addChart (Account acct) session.save (acct); } + /** + * Add a Journal + * Check permissions. + * + * @param j The new Journal + * @throws HibernateException on error + * @throws GLException if user doesn't have write permission + */ + public void addJournal (Journal j) throws HibernateException, GLException + { + checkPermission (GLPermission.WRITE); + session.save (j); + } + /** * @param chart chart of accounts. * @param code account's code. @@ -1529,7 +1543,7 @@ public void lock (Journal journal, Account acct) */ public synchronized Session open () throws HibernateException { return db.open(); - } + } /** * Close underlying Hibernate session. * @throws HibernateException