This is an automated email from the git hooks/post-receive script. New commit to branch 3784-hibernate5 in repository topia-2.x. See http://git.nuiton.org/topia-2.x.git commit 45deac9c74268797b3dc9d28340ee03c9cfa6e1c Author: Eric Chatellier <chatellier@codelutin.com> Date: Mon Feb 22 17:04:50 2016 +0100 refs #3784: readd updateSchema method --- .../src/main/java/org/nuiton/topia/TopiaContext.java | 7 +++++++ .../org/nuiton/topia/framework/TopiaContextImpl.java | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java b/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java index b6799a4..e4ef10b 100644 --- a/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java +++ b/topia-persistence/src/main/java/org/nuiton/topia/TopiaContext.java @@ -136,6 +136,13 @@ public interface TopiaContext { void showCreateSchema() throws TopiaException; /** + * Permet de mettre à jour le schema de la base de données. + * + * @throws TopiaException if any exception + */ + void updateSchema() throws TopiaException; + + /** * Return a new context containing his own transaction. * * @return new context with transaction diff --git a/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java b/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java index 075d7d1..749f569 100644 --- a/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java +++ b/topia-persistence/src/main/java/org/nuiton/topia/framework/TopiaContextImpl.java @@ -465,6 +465,23 @@ public class TopiaContextImpl implements TopiaContextImplementor { eee.getMessage()), eee); } } + + @Override + public void updateSchema() throws TopiaException { + try { + EnumSet<TargetType> targetTypes = EnumSet.of(TargetType.DATABASE); + if (log.isDebugEnabled()) { + targetTypes = EnumSet.of(TargetType.DATABASE, TargetType.STDOUT); + } + getFiresSupport().firePreUpdateSchema(this); + new SchemaUpdate().execute(targetTypes, getMetadata()); + getFiresSupport().firePostUpdateSchema(this); + } catch (HibernateException eee) { + throw new TopiaException( + t("topia.persistence.error.update.schema", + eee.getMessage()), eee); + } + } @Override public void showCreateSchema() throws TopiaException { -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.