Sandbox-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
May 2013
- 3 participants
- 34 discussions
r639 - in nuiton-jpa/nuiton-jpa-api: . src/main/java/org/nuiton/jpa/api/hibernate
by bleny@users.nuiton.org 31 May '13
by bleny@users.nuiton.org 31 May '13
31 May '13
Author: bleny
Date: 2013-05-31 11:48:12 +0200 (Fri, 31 May 2013)
New Revision: 639
Url: http://nuiton.org/projects/sandbox/repository/revisions/639
Log:
fix nosense configuration for h2 in HibernateUtil
Modified:
nuiton-jpa/nuiton-jpa-api/pom.xml
nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/hibernate/HibernateUtil.java
Modified: nuiton-jpa/nuiton-jpa-api/pom.xml
===================================================================
--- nuiton-jpa/nuiton-jpa-api/pom.xml 2013-05-30 09:49:50 UTC (rev 638)
+++ nuiton-jpa/nuiton-jpa-api/pom.xml 2013-05-31 09:48:12 UTC (rev 639)
@@ -46,6 +46,11 @@
<artifactId>commons-logging</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+
</dependencies>
<build>
Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/hibernate/HibernateUtil.java
===================================================================
--- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/hibernate/HibernateUtil.java 2013-05-30 09:49:50 UTC (rev 638)
+++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/hibernate/HibernateUtil.java 2013-05-31 09:48:12 UTC (rev 639)
@@ -40,7 +40,6 @@
import javax.persistence.Persistence;
import java.io.File;
import java.lang.reflect.Field;
-import java.sql.Driver;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -63,7 +62,7 @@
Map<String, String> hibernateH2Config = new HashMap<String, String>();
- hibernateH2Config.put(AvailableSettings.JDBC_DRIVER, Driver.class.getName());
+ hibernateH2Config.put(AvailableSettings.JDBC_DRIVER, org.h2.Driver.class.getName());
hibernateH2Config.put(AvailableSettings.JDBC_USER, "sa");
hibernateH2Config.put(AvailableSettings.JDBC_PASSWORD, "");
hibernateH2Config.put(Environment.DIALECT, org.hibernate.dialect.H2Dialect.class.getName());
1
0
30 May '13
Author: tchemit
Date: 2013-05-30 11:49:50 +0200 (Thu, 30 May 2013)
New Revision: 638
Url: http://nuiton.org/projects/sandbox/repository/revisions/638
Log:
add id generator mecanism
Added:
nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java
nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java
nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/LICENSE.txt
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/README.txt
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/changelog.txt
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/goals.txt
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/pom.xml
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/postbuild.groovy
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties
nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.zargo
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java
Modified:
nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java
nuiton-jpa/nuiton-jpa-templates/src/it/magalie/pom.xml
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaMetaTransformer.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java
Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java
===================================================================
--- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java 2013-05-29 13:23:18 UTC (rev 637)
+++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -41,6 +41,14 @@
protected EntityTransaction entityTransaction;
public AbstractJpaPersistenceContext(EntityManager entityManager) {
+ this(null, entityManager);
+ }
+
+ public AbstractJpaPersistenceContext(JpaEntityIdGenerator idGenerator,
+ EntityManager entityManager) {
+ if (idGenerator != null) {
+ JpaEntityIdGeneratorFactory.setGenerator(idGenerator);
+ }
this.entityManager = entityManager;
entityTransaction = entityManager.getTransaction();
if (!entityTransaction.isActive()) {
Added: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java
===================================================================
--- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java (rev 0)
+++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1,44 @@
+package org.nuiton.jpa.api;
+
+/*
+ * #%L
+ * Nuiton Jpa :: API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * Default implementation of {@link JpaEntityIdGenerator}.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class DefaultJpaEntityIdGenerator implements JpaEntityIdGenerator {
+
+ @Override
+ public String generate(JpaEntity entity) {
+ double random = Math.random();
+ while (Double.toString(random).contains("E-")) {
+ random = Math.random();
+ }
+ return entity.getClass().getName() + '#' + System.currentTimeMillis() + '#'
+ + random;
+ }
+}
Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/DefaultJpaEntityIdGenerator.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java
===================================================================
--- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java (rev 0)
+++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1,36 @@
+package org.nuiton.jpa.api;
+
+/*
+ * #%L
+ * Nuiton Jpa :: API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+/**
+ * To generate entity id.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public interface JpaEntityIdGenerator {
+
+ String generate(JpaEntity entity);
+}
Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGenerator.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java
===================================================================
--- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java (rev 0)
+++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1,48 @@
+package org.nuiton.jpa.api;
+
+/*
+ * #%L
+ * Nuiton Jpa :: API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import com.google.common.base.Preconditions;
+
+/**
+ * {@link JpaEntityIdGenerator} used in generated code in entities.
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public class JpaEntityIdGeneratorFactory implements JpaEntityIdGenerator {
+
+ protected static JpaEntityIdGenerator generator;
+
+ public static void setGenerator(JpaEntityIdGenerator generator) {
+ JpaEntityIdGeneratorFactory.generator = generator;
+ }
+
+ @Override
+ public String generate(JpaEntity entity) {
+ Preconditions.checkNotNull(generator, "No generator assigned.");
+ return generator.generate(entity);
+ }
+}
Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaEntityIdGeneratorFactory.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: nuiton-jpa/nuiton-jpa-templates/src/it/magalie/pom.xml
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/it/magalie/pom.xml 2013-05-29 13:23:18 UTC (rev 637)
+++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie/pom.xml 2013-05-30 09:49:50 UTC (rev 638)
@@ -90,7 +90,8 @@
com.franciaflex.magalie.persistence.entity
</fullPackagePath>
<!-- defaultPackage used for generation -->
- <defaultPackage>com.franciaflex.magalie.persistence
+ <defaultPackage>
+ com.franciaflex.magalie.persistence
</defaultPackage>
<templates>
org.nuiton.eugene.java.JavaEnumerationTransformer,
Copied: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/LICENSE.txt (from rev 636, nuiton-jpa/nuiton-jpa-templates/src/it/magalie/LICENSE.txt)
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/LICENSE.txt (rev 0)
+++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/LICENSE.txt 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1,166 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+
Copied: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/README.txt (from rev 636, nuiton-jpa/nuiton-jpa-templates/src/it/magalie/README.txt)
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/README.txt (rev 0)
+++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/README.txt 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1 @@
+Test jpa templates on project Magalie (see http://forge.codelutin.com/projects/franciaflex-magalie)
\ No newline at end of file
Copied: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/changelog.txt (from rev 636, nuiton-jpa/nuiton-jpa-templates/src/it/magalie/changelog.txt)
===================================================================
Copied: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/goals.txt (from rev 636, nuiton-jpa/nuiton-jpa-templates/src/it/magalie/goals.txt)
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/goals.txt (rev 0)
+++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/goals.txt 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1 @@
+clean compile
\ No newline at end of file
Copied: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/pom.xml (from rev 636, nuiton-jpa/nuiton-jpa-templates/src/it/magalie/pom.xml)
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/pom.xml (rev 0)
+++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/pom.xml 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ EUGene :: Maven plugin
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2006 - 2010 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.nuiton.jpa.templates.test</groupId>
+ <artifactId>magalie</artifactId>
+ <version>@pom.version@</version>
+
+ <name>Nuiton Jpa Temlates :: Test magalie model</name>
+
+ <properties>
+
+ <eugeneVersion>@eugeneVersion@</eugeneVersion>
+
+ <!-- default encoding -->
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+
+ <!-- compiler configuration -->
+ <maven.compiler.source>1.6</maven.compiler.source>
+ <maven.compiler.target>1.6</maven.compiler.target>
+
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.nuiton.jpa</groupId>
+ <artifactId>nuiton-jpa-api</artifactId>
+ <version>@pom.version@</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.eugene</groupId>
+ <artifactId>eugene-maven-plugin</artifactId>
+ <version>${eugeneVersion}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.nuiton.eugene</groupId>
+ <artifactId>eugene-maven-plugin</artifactId>
+ <configuration>
+ <inputs>zargo</inputs>
+ <resolver>org.nuiton.util.FasterCachedResourceResolver</resolver>
+ </configuration>
+ <executions>
+ <execution>
+ <id>generate-entities</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <!-- Corresponding to extracted package from zargo file -->
+ <fullPackagePath>
+ com.franciaflex.magalie.persistence.entity
+ </fullPackagePath>
+ <!-- defaultPackage used for generation -->
+ <defaultPackage>
+ com.franciaflex.magalie.persistence
+ </defaultPackage>
+ <templates>
+ org.nuiton.eugene.java.JavaEnumerationTransformer,
+ org.nuiton.jpa.templates.JpaMetaTransformer
+ </templates>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.nuiton.jpa</groupId>
+ <artifactId>nuiton-jpa-templates</artifactId>
+ <version>@pom.version@</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
+
+
Copied: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/postbuild.groovy (from rev 636, nuiton-jpa/nuiton-jpa-templates/src/it/magalie/postbuild.groovy)
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/postbuild.groovy (rev 0)
+++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/postbuild.groovy 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1,39 @@
+/*
+ * #%L
+ * nuiton-jpa-templates
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+outputDir = new File(basedir, 'target/generated-sources/java');
+
+file = new File(outputDir, 'com/franciaflex/magalie/persistence');
+assert file.exists();
+assert file.isDirectory();
+
+file = new File(outputDir, 'com/franciaflex/magalie/persistence/entity');
+assert file.exists();
+assert file.isDirectory();
+
+file = new File(outputDir, 'com/franciaflex/magalie/persistence/dao');
+assert file.exists();
+assert file.isDirectory();
+
+return true;
\ No newline at end of file
Added: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties (rev 0)
+++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1,37 @@
+###
+# #%L
+# Nuiton Jpa :: Temlates
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2013 CodeLutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+model.tagValue.idGenerator=org.nuiton.jpa.api.DefaultJpaEntityIdGenerator
+
+com.franciaflex.magalie.persistence.entity.Article.attribute.fixedLocations.stereotype=unique
+
+com.franciaflex.magalie.persistence.entity.Article.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.Building.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.Location.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.MagalieUser.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.PreparedArticleReception.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.RequestedArticle.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.RequestedList.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.StoredArticle.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.Supplier.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.Warehouse.class.stereotype=notGeneratedValue
Property changes on: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.properties
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Added: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.zargo
===================================================================
(Binary files differ)
Property changes on: nuiton-jpa/nuiton-jpa-templates/src/it/magalie-with-generated-value/src/main/xmi/magalie.zargo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: svn:keywords
+ Author Date Id Revision HeadURL
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-05-29 13:23:18 UTC (rev 637)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -38,6 +38,7 @@
import org.nuiton.eugene.models.object.ObjectModelOperation;
import org.nuiton.eugene.models.object.xml.ObjectModelAttributeImpl;
import org.nuiton.jpa.api.AbstractJpaEntity;
+import org.nuiton.jpa.api.JpaEntityIdGeneratorFactory;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
@@ -51,6 +52,7 @@
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderColumn;
+import javax.persistence.PrePersist;
import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -87,18 +89,25 @@
String entityConcreteName = JpaTemplatesGeneratorUtil.getEntityConcreteName(input);
- boolean generateAbstract = !isInClassPath(packageName, entityAbstractName);
+ boolean generateAbstract = !isInClassPath(packageName,
+ entityAbstractName);
- boolean generateConcrete = !isInClassPath(packageName, entityConcreteName);
+ boolean generateConcrete = !isInClassPath(packageName,
+ entityConcreteName);
if (generateAbstract) {
- generateAbstract(input, packageName, entityAbstractName);
+ generateAbstract(input,
+ packageName,
+ entityAbstractName);
}
if (generateConcrete) {
- generateImpl(input, packageName, entityAbstractName, entityConcreteName);
+ generateImpl(input,
+ packageName,
+ entityAbstractName,
+ entityConcreteName);
}
}
@@ -156,6 +165,28 @@
addSerializable(input, output, serializableFound);
+ String idGenerator =
+ JpaTemplatesGeneratorUtil.getIdGeneratorTagValue(getModel());
+
+ if (StringUtils.isNotEmpty(idGenerator)) {
+
+ // use an idGenerator
+
+ // add prepersist method
+ ObjectModelOperation operation = addOperation(
+ output,
+ "prepersist",
+ String.class,
+ ObjectModelJavaModifier.PUBLIC);
+ addAnnotation(output, operation, PrePersist.class);
+ addImport(output, JpaEntityIdGeneratorFactory.class);
+ setOperationBody(operation, ""
+ /*{
+ return new JpaEntityIdGeneratorFactory().generate(this);
+ }*/
+ );
+ }
+
Set<String> constantNames = addConstantsFromDependency(input, output);
// Get available properties
@@ -241,7 +272,7 @@
if (PROPERTY_ID.equals(propertyName)) {
addAnnotation(result, property, output, Id.class);
- if (!JpaTemplatesGeneratorUtil.hasNotGeneratedValueStereotype(input)) {
+ if (JpaTemplatesGeneratorUtil.generateEntityGeneratedValueAnnotation(model, input)) {
addAnnotation(result, property, output, GeneratedValue.class);
}
continue;
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaMetaTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaMetaTransformer.java 2013-05-29 13:23:18 UTC (rev 637)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaMetaTransformer.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -84,8 +84,7 @@
classValidator.addNameAndReason("user", "Nom de classe incompatible avec certains SGBD");
validators.add(classValidator);
-// validators.add(new TopiaJavaValidator(model));
-// validators.add(new TopiaRelationValidator(model));
+ validators.add(new JpaModelValidator(model));
for (ObjectModelValidator validator : validators) {
if (!validator.validate()) {
Added: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java (rev 0)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -0,0 +1,69 @@
+package org.nuiton.jpa.templates;
+
+/*
+ * #%L
+ * Nuiton Jpa :: Temlates
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.lang3.StringUtils;
+import org.nuiton.eugene.models.object.ObjectModel;
+import org.nuiton.eugene.models.object.ObjectModelClass;
+import org.nuiton.eugene.models.object.ObjectModelClassifier;
+import org.nuiton.eugene.models.object.validator.ObjectModelValidator;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since TODO
+ */
+public class JpaModelValidator extends ObjectModelValidator {
+ public JpaModelValidator(ObjectModel model) {
+ super(model);
+ }
+
+ boolean useIdGenerator;
+
+ @Override
+ protected boolean validateModel(ObjectModel model) {
+
+ String idGeneratorTagValue = JpaTemplatesGeneratorUtil.getIdGeneratorTagValue(model);
+ useIdGenerator = StringUtils.isNotEmpty(idGeneratorTagValue);
+ return super.validateModel(model);
+ }
+
+ @Override
+ protected boolean validateClass(ObjectModelClass clazz) {
+ if (JpaTemplatesGeneratorUtil.isEntity(clazz)) {
+
+ if (useIdGenerator) {
+
+ // can't have any stuff around GeneraturValue
+ if(JpaTemplatesGeneratorUtil.hasNotGeneratedValueStereotype(clazz)) {
+
+ addError(clazz,"Can't use a NotGenerated tag value when using an id generator");
+ }
+ }
+ }
+ return super.validateClass(clazz);
+ }
+}
Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaModelValidator.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java 2013-05-29 13:23:18 UTC (rev 637)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -24,11 +24,15 @@
* #L%
*/
+import org.apache.commons.lang3.StringUtils;
import org.nuiton.eugene.models.object.ObjectModel;
import org.nuiton.eugene.models.object.ObjectModelClass;
+import org.nuiton.eugene.models.object.ObjectModelJavaModifier;
import org.nuiton.eugene.models.object.ObjectModelOperation;
import org.nuiton.jpa.api.AbstractJpaPersistenceContext;
+import org.nuiton.jpa.api.JpaEntityIdGenerator;
+import javax.persistence.EntityManager;
import java.util.List;
/*{generator option: parentheses = false}*/
@@ -91,8 +95,29 @@
setSuperClass(output, superClass);
- addConstructorWithEntityManager(output);
+ String idGenerator =
+ JpaTemplatesGeneratorUtil.getIdGeneratorTagValue(getModel());
+ if (StringUtils.isNotEmpty(idGenerator)) {
+
+ // using an idGenerator
+ ObjectModelOperation constructor = addConstructor(
+ output,
+ ObjectModelJavaModifier.PUBLIC);
+
+ addParameter(constructor, EntityManager.class, "entityManager");
+
+ setOperationBody(constructor, ""
+ /*{
+ super(new <%=idGenerator%>(), entityManager);
+ }*/
+ );
+ } else {
+
+ // not using an idGenerator
+ addConstructorWithEntityManager(output);
+ }
+
// add dao factories
List<ObjectModelClass> entityClasses =
JpaTemplatesGeneratorUtil.getEntityClasses(getModel(), true);
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-05-29 13:23:18 UTC (rev 637)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -234,37 +234,36 @@
}
/**
- * Obtain the value of the {@link JpaTemplatesTagValues#TAG_ENTITY_SUPER_CLASS}
+ * Obtain the value of the {@link JpaTemplatesTagValues#TAG_ID_GENERATOR}
* tag value on the given model or classifier.
* <p/>
* It will first look on the model, and then in the given classifier.
*
- * @param model model to seek
- * @param classifier classifier to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see JpaTemplatesTagValues#TAG_ENTITY_SUPER_CLASS
+ * @param model model to seek
+ * @return the none empty value of the found tag value or {@code null}
+ * if not found nor empty.
+ * @see JpaTemplatesTagValues#TAG_ID_GENERATOR
* @since 2.3
*/
- public static String getEntitySuperClassTagValue(ObjectModel model, ObjectModelClassifier classifier) {
- String value = findTagValue(JpaTemplatesTagValues.TAG_ENTITY_SUPER_CLASS, classifier, model);
+ public static String getIdGeneratorTagValue(ObjectModel model) {
+ String value = findTagValue(JpaTemplatesTagValues.TAG_ID_GENERATOR, null, model);
return value;
}
/**
- * Obtain the value of the {@link JpaTemplatesTagValues#TAG_ENTITY_PACKAGE}
- * tag value on the given model.
+ * Obtain the value of the {@link JpaTemplatesTagValues#TAG_ENTITY_SUPER_CLASS}
+ * tag value on the given model or classifier.
* <p/>
* It will first look on the model, and then in the given classifier.
*
* @param model model to seek
* @param classifier classifier to seek
* @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see JpaTemplatesTagValues#TAG_ENTITY_PACKAGE
+ * @see JpaTemplatesTagValues#TAG_ENTITY_SUPER_CLASS
* @since 2.3
*/
- public static String getEntityPackageTagValue(ObjectModel model,
- ObjectModelClassifier classifier) {
- String value = findTagValue(JpaTemplatesTagValues.TAG_ENTITY_PACKAGE, classifier, model);
+ public static String getEntitySuperClassTagValue(ObjectModel model, ObjectModelClassifier classifier) {
+ String value = findTagValue(JpaTemplatesTagValues.TAG_ENTITY_SUPER_CLASS, classifier, model);
return value;
}
@@ -286,24 +285,6 @@
}
/**
- * Obtain the value of the {@link JpaTemplatesTagValues#TAG_DAO_PACKAGE}
- * tag value on the given model.
- * <p/>
- * It will first look on the model, and then in the given classifier.
- *
- * @param model model to seek
- * @param classifier classifier to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see JpaTemplatesTagValues#TAG_DAO_PACKAGE
- * @since 2.3
- */
- public static String getDaoPackageTagValue(ObjectModel model,
- ObjectModelClassifier classifier) {
- String value = findTagValue(JpaTemplatesTagValues.TAG_DAO_PACKAGE, classifier, model);
- return value;
- }
-
- /**
* Obtain the value of the {@link JpaTemplatesTagValues#TAG_PERSISTENCE_CONTEXT_SUPER_CLASS}
* tag value on the given model.
*
@@ -318,21 +299,6 @@
}
/**
- * Obtain the value of the {@link JpaTemplatesTagValues#TAG_PERSISTENCE_CONTEXT_PACKAGE}
- * tag value on the given model.
- * <p/>
- *
- * @param model model to seek
- * @return the none empty value of the found tag value or {@code null} if not found nor empty.
- * @see JpaTemplatesTagValues#TAG_PERSISTENCE_CONTEXT_PACKAGE
- * @since 2.3
- */
- public static String getPersistenceContextPackageTagValue(ObjectModel model) {
- String value = findTagValue(JpaTemplatesTagValues.TAG_PERSISTENCE_CONTEXT_PACKAGE, null, model);
- return value;
- }
-
- /**
* Obtain the value of the {@link JpaTemplatesTagValues#TAG_INVERSE}
* tag value on the given attribute.
* <p/>
@@ -360,6 +326,18 @@
return attribute.hasStereotype(JpaTemplatesStereoTypes.STEREOTYPE_UNIQUE);
}
+ public static boolean generateEntityGeneratedValueAnnotation(ObjectModel model,
+ ObjectModelClass clazz) {
+ String idGeneratorTagValue = getIdGeneratorTagValue(model);
+ boolean result = idGeneratorTagValue == null;
+ if (result) {
+
+ // check entity is not marked to not generate value
+ result = !hasNotGeneratedValueStereotype(clazz);
+ }
+ return result;
+ }
+
/**
* Check if the given class has the
* {@link JpaTemplatesStereoTypes#STEREOTYPE_NOT_GENERATED_VALUE} stereotype.
@@ -369,7 +347,7 @@
* @see JpaTemplatesStereoTypes#STEREOTYPE_NOT_GENERATED_VALUE
* @since 2.5
*/
- public static boolean hasNotGeneratedValueStereotype(ObjectModelClass clazz) {
+ public static boolean hasNotGeneratedValueStereotype(ObjectModelClassifier clazz) {
return clazz.hasStereotype(JpaTemplatesStereoTypes.STEREOTYPE_NOT_GENERATED_VALUE);
}
}
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java 2013-05-29 13:23:18 UTC (rev 637)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -28,6 +28,7 @@
import org.nuiton.eugene.ModelPropertiesUtil;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
import org.nuiton.eugene.models.object.ObjectModelClass;
+import org.nuiton.eugene.models.object.ObjectModelClassifier;
import javax.persistence.GeneratedValue;
@@ -49,11 +50,11 @@
String STEREOTYPE_UNIQUE = "unique";
/**
- * Stéréotype pour ne pas générer l' annotation {@link GeneratedValue} sur une entité.
+ * Stéréotype pour ne pas générer l'annotation {@link GeneratedValue} sur une entité.
*
- * @see JpaTemplatesGeneratorUtil#hasNotGeneratedValueStereotype(ObjectModelAttribute)
+ * @see JpaTemplatesGeneratorUtil#hasNotGeneratedValueStereotype(ObjectModelClassifier)
*/
- @ModelPropertiesUtil.StereotypeDefinition(target = ObjectModelClass.class,
+ @ModelPropertiesUtil.StereotypeDefinition(target = ObjectModelClassifier.class,
documentation = "To specify that an entity deal by itself with his id, the GeneratedValue annotation will not be generated then(JPA mapping)")
String STEREOTYPE_NOT_GENERATED_VALUE = "notGeneratedValue";
}
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java 2013-05-29 13:23:18 UTC (rev 637)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java 2013-05-30 09:49:50 UTC (rev 638)
@@ -51,17 +51,6 @@
String TAG_ENTITY_SUPER_CLASS = "entitySuperClass";
/**
- * Tag value to specify where to generate entities.
- *
- * @see JpaTemplatesGeneratorUtil#getEntityPackageTagValue(ObjectModel, ObjectModelClassifier)
- * @since 0.1
- */
- @ModelPropertiesUtil.TagValueDefinition(
- target = {ObjectModel.class},
- documentation = "To specify the package where to generate entities")
- String TAG_ENTITY_PACKAGE = "entityPackage";
-
- /**
* Tag value to use a super class for generated bean.
*
* @see JpaTemplatesGeneratorUtil#getDaoSuperClassTagValue(ObjectModel, ObjectModelClassifier)
@@ -74,17 +63,6 @@
String TAG_DAO_SUPER_CLASS = "daoSuperClass";
/**
- * Tag value to specify where to generate daos.
- *
- * @see JpaTemplatesGeneratorUtil#getDaoPackageTagValue(ObjectModel, ObjectModelClassifier)
- * @since 0.1
- */
- @ModelPropertiesUtil.TagValueDefinition(
- target = {ObjectModel.class},
- documentation = "To specify the package where to generate daos")
- String TAG_DAO_PACKAGE = "daoPackage";
-
- /**
* Tag value to use a super class for generated bean.
*
* @see JpaTemplatesGeneratorUtil#getDaoSuperClassTagValue(ObjectModel, ObjectModelClassifier)
@@ -96,18 +74,6 @@
String TAG_PERSISTENCE_CONTEXT_SUPER_CLASS = "persistenceContextSuperClass";
/**
- * Tag value to specify where to generate persistenceContext.
- *
- * @see JpaTemplatesGeneratorUtil#getPersistenceContextPackageTagValue(ObjectModel)
- * @since 0.1
- */
- @ModelPropertiesUtil.TagValueDefinition(
- target = {ObjectModel.class},
- documentation = "To specify the package where to generate persistenceContexts")
- String TAG_PERSISTENCE_CONTEXT_PACKAGE = "persistenceContextPackage";
-
-
- /**
* Tag pour permettre de choisir qui contrôle la relation N-N
* bidirectionnelle. On a inverse=true sur le père de la relation..
* <p/>
@@ -120,4 +86,15 @@
@ModelPropertiesUtil.TagValueDefinition(target = {ObjectModelAttribute.class},
documentation = "Sets which part of a N-N relation is master (inverse=true) and slave (inverse=false) (must be put on each side on a such relation) (Hibernate mapping)")
String TAG_INVERSE = "inverse";
+
+ /**
+ * Tag value to get user defined id generator.
+ *
+ * @see JpaTemplatesGeneratorUtil#getIdGeneratorTagValue(ObjectModel)
+ * @since 0.1
+ */
+ @ModelPropertiesUtil.TagValueDefinition(
+ target = {ObjectModel.class},
+ documentation = "To specify a user defined id generator to use for all entities of the model")
+ String TAG_ID_GENERATOR = "idGenerator";
}
1
0
r637 - in nuiton-jpa: . nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates
by tchemit@users.nuiton.org 29 May '13
by tchemit@users.nuiton.org 29 May '13
29 May '13
Author: tchemit
Date: 2013-05-29 15:23:18 +0200 (Wed, 29 May 2013)
New Revision: 637
Url: http://nuiton.org/projects/sandbox/repository/revisions/637
Log:
- use last snapshot of eugene
- remove generic from dao
Modified:
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java
nuiton-jpa/pom.xml
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java 2013-05-29 09:21:09 UTC (rev 636)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java 2013-05-29 13:23:18 UTC (rev 637)
@@ -58,26 +58,19 @@
String packageName = JpaTemplatesGeneratorUtil.getDaoPackage(this, model, input);
- String generatedDaoName = JpaTemplatesGeneratorUtil.getDaoGeneratedName(input);
String abstractDaoName = JpaTemplatesGeneratorUtil.getDaoAbstractName(input);
String concreteDaoName = JpaTemplatesGeneratorUtil.getDaoConcreteName(input);
- String concreteEntityQualifiedName=
+ String concreteEntityQualifiedName =
JpaTemplatesGeneratorUtil.getConcreteEntityQualifiedName(this, model, input);
- boolean generateGenerated= !isInClassPath(packageName, generatedDaoName);
boolean generateAbstract = !isInClassPath(packageName, abstractDaoName);
boolean generateConcrete = !isInClassPath(packageName, concreteDaoName);
- if (generateGenerated) {
-
- generateGenerated(input, packageName, generatedDaoName, concreteEntityQualifiedName);
- }
-
if (generateAbstract) {
- generateAbstract(input, packageName, generatedDaoName, abstractDaoName, concreteEntityQualifiedName);
+ generateAbstract(input, packageName, abstractDaoName, concreteEntityQualifiedName);
}
if (generateConcrete) {
@@ -86,13 +79,15 @@
}
}
- protected ObjectModelClass generateGenerated(ObjectModelClass input,
+ protected ObjectModelClass generateAbstract(ObjectModelClass input,
String packageName,
String abstractDaoName,
String concreteEntityQualifiedName) {
+ String entityName = input.getName();
+
ObjectModelClass output =
- createAbstractClass(abstractDaoName + "<E extends " + input.getName() + ">", packageName);
+ createAbstractClass(abstractDaoName, packageName);
addImport(output, concreteEntityQualifiedName);
// test if a super class is in same package (so is yet another entity)
@@ -117,7 +112,7 @@
if (superClass == null) {
// no super-class, use default one
- superClass = AbstractJpaDao.class.getName() + "<E>";
+ superClass = AbstractJpaDao.class.getName() + "<" + entityName + ">";
addImport(output, superClass);
}
}
@@ -126,7 +121,7 @@
addConstructorWithEntityManager(output);
// detect if there is a contract to set on abstract
- String daoContractName = packageName + "." + input.getName() + "Dao";
+ String daoContractName = packageName + "." + entityName + "Dao";
boolean addUserDaoContract = isInClassPath(daoContractName);
@@ -136,11 +131,11 @@
// Add getEntityClass
- ObjectModelOperation operation = addOperation(output, "getEntityClass", "Class<E>", ObjectModelJavaModifier.PROTECTED);
+ ObjectModelOperation operation = addOperation(output, "getEntityClass", "Class<" + entityName + ">", ObjectModelJavaModifier.PROTECTED);
addAnnotation(output, operation, Override.class);
setOperationBody(operation, ""
/*{
- return (Class<E>) <%=input.getName()%>.class;
+ return <%=entityName%>.class;
}*/
);
@@ -150,33 +145,15 @@
return output;
}
- protected ObjectModelClass generateAbstract(ObjectModelClass input,
+ protected ObjectModelClass generateImpl(ObjectModelClass input,
String packageName,
- String generatedDaoName,
String abstractDaoName,
+ String concreteDaoName,
String concreteEntityQualifiedName) {
- ObjectModelClass output = createAbstractClass(abstractDaoName+ "<E extends " + input.getName() + ">", packageName);
-
- setSuperClass(output, packageName + '.' + generatedDaoName + "<E>");
- addImport(output, concreteEntityQualifiedName);
- addConstructorWithEntityManager(output);
-
- if (isVerbose()) {
- log.info("will generate " + output.getQualifiedName());
- }
- return output;
- }
-
- protected ObjectModelClass generateImpl(ObjectModelClass input,
- String packageName,
- String abstractDaoName,
- String concreteDaoName,
- String concreteEntityQualifiedName) {
-
ObjectModelClass output = createClass(concreteDaoName, packageName);
- setSuperClass(output, packageName + '.' + abstractDaoName + "<" + input.getName() + ">");
+ setSuperClass(output, packageName + '.' + abstractDaoName);
addImport(output, concreteEntityQualifiedName);
addConstructorWithEntityManager(output);
Modified: nuiton-jpa/pom.xml
===================================================================
--- nuiton-jpa/pom.xml 2013-05-29 09:21:09 UTC (rev 636)
+++ nuiton-jpa/pom.xml 2013-05-29 13:23:18 UTC (rev 637)
@@ -31,7 +31,7 @@
<redmine.skipGenerateChanges>true</redmine.skipGenerateChanges>
<!-- libs version -->
- <eugeneVersion>2.6.3-SNAPSHOT</eugeneVersion>
+ <eugeneVersion>2.6.4-SNAPSHOT</eugeneVersion>
<processorPluginVersion>1.3</processorPluginVersion>
<h2Version>1.3.170</h2Version>
<hibernateVersion>4.1.11.Final</hibernateVersion>
1
0
r636 - in nuiton-jpa/nuiton-jpa-templates/src: it/magalie main/java/org/nuiton/jpa/templates
by tchemit@users.nuiton.org 29 May '13
by tchemit@users.nuiton.org 29 May '13
29 May '13
Author: tchemit
Date: 2013-05-29 11:21:09 +0200 (Wed, 29 May 2013)
New Revision: 636
Url: http://nuiton.org/projects/sandbox/repository/revisions/636
Log:
add a jpa meta transformer
Added:
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaMetaTransformer.java
Modified:
nuiton-jpa/nuiton-jpa-templates/src/it/magalie/pom.xml
Modified: nuiton-jpa/nuiton-jpa-templates/src/it/magalie/pom.xml
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/it/magalie/pom.xml 2013-05-29 08:54:49 UTC (rev 635)
+++ nuiton-jpa/nuiton-jpa-templates/src/it/magalie/pom.xml 2013-05-29 09:21:09 UTC (rev 636)
@@ -86,16 +86,15 @@
<phase>generate-sources</phase>
<configuration>
<!-- Corresponding to extracted package from zargo file -->
- <fullPackagePath>com.franciaflex.magalie.persistence.entity
+ <fullPackagePath>
+ com.franciaflex.magalie.persistence.entity
</fullPackagePath>
<!-- defaultPackage used for generation -->
<defaultPackage>com.franciaflex.magalie.persistence
</defaultPackage>
<templates>
- org.nuiton.jpa.templates.JpaEntityTransformer,
- org.nuiton.jpa.templates.JpaDaoTransformer,
- org.nuiton.jpa.templates.JpaPersistenceContextTransformer,
- org.nuiton.eugene.java.JavaEnumerationTransformer
+ org.nuiton.eugene.java.JavaEnumerationTransformer,
+ org.nuiton.jpa.templates.JpaMetaTransformer
</templates>
</configuration>
<goals>
Added: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaMetaTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaMetaTransformer.java (rev 0)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaMetaTransformer.java 2013-05-29 09:21:09 UTC (rev 636)
@@ -0,0 +1,115 @@
+package org.nuiton.jpa.templates;
+
+/*
+ * #%L
+ * Nuiton Jpa :: Temlates
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.eugene.AbstractMetaTransformer;
+import org.nuiton.eugene.models.object.ObjectModel;
+import org.nuiton.eugene.models.object.ObjectModelClass;
+import org.nuiton.eugene.models.object.validator.AttributeNamesValidator;
+import org.nuiton.eugene.models.object.validator.ClassNamesValidator;
+import org.nuiton.eugene.models.object.validator.ObjectModelValidator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created: 20 déc. 2009
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @version $Id$
+ * @plexus.component role="org.nuiton.eugene.Template" role-hint="org.nuiton.jpa.templates.JpaMetaTransformer"
+ * @since 2.3.0
+ */
+public class JpaMetaTransformer extends AbstractMetaTransformer<ObjectModel> {
+
+ /** Logger */
+ private static final Log log = LogFactory.getLog(JpaMetaTransformer.class);
+
+ public JpaMetaTransformer() {
+
+ setTemplateTypes(
+ JpaEntityTransformer.class,
+ JpaDaoTransformer.class,
+ JpaPersistenceContextTransformer.class
+ );
+ }
+
+ protected boolean validateModel(ObjectModel model) {
+ List<ObjectModelValidator> validators = new ArrayList<ObjectModelValidator>();
+
+ AttributeNamesValidator attrValidator = new AttributeNamesValidator(
+ model);
+ attrValidator.addNameAndReason("next",
+ "Le nom d'attribut \"next\" est incompatible avec HSQL");
+ attrValidator.addNameAndReason("value",
+ "Le nom d'attribut \"value\" est incompatible avec certains SGBD");
+ attrValidator.addNameAndReason("values",
+ "Le nom d'attribut \"values\" est incompatible avec certains SGBD");
+ attrValidator.addNameAndReason("begin",
+ "Le nom d'attribut \"begin\" est incompatible avec certains SGBD");
+ attrValidator.addNameAndReason("end",
+ "Le nom d'attribut \"end\" est incompatible avec certains SGBD");
+ attrValidator.addNameAndReason("authorization",
+ "Le nom d'attribut \"authorization\" est incompatible avec certains SGBD");
+ attrValidator.addNameAndReason("order",
+ "Le nom d'attribut \"order\" est incompatible avec certains SGBD");
+ validators.add(attrValidator);
+
+ ClassNamesValidator classValidator = new ClassNamesValidator(model);
+ classValidator.addNameAndReason("constraint", "Nom de classe incompatible avec certains SGBD");
+ classValidator.addNameAndReason("user", "Nom de classe incompatible avec certains SGBD");
+ validators.add(classValidator);
+
+// validators.add(new TopiaJavaValidator(model));
+// validators.add(new TopiaRelationValidator(model));
+
+ for (ObjectModelValidator validator : validators) {
+ if (!validator.validate()) {
+ for (String error : validator.getErrors()) {
+ if (log.isWarnEnabled()) {
+ log.warn("[VALIDATION] " + error);
+ }
+ }
+ }
+ }
+
+ // test before all if there is some entities to generate
+ List<ObjectModelClass> classes =
+ JpaTemplatesGeneratorUtil.getEntityClasses(model, true);
+
+ if (classes.isEmpty()) {
+ // no entity to generate, can stop safely
+ if (log.isWarnEnabled()) {
+ log.warn("No entity to generate, " + getClass().getName() +
+ " is skipped");
+ }
+ return false;
+ }
+ return true;
+ }
+
+}
Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaMetaTransformer.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
1
0
r635 - in nuiton-jpa: nuiton-jpa-api/src/main/java/org/nuiton/jpa/api nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates
by tchemit@users.nuiton.org 29 May '13
by tchemit@users.nuiton.org 29 May '13
29 May '13
Author: tchemit
Date: 2013-05-29 10:54:49 +0200 (Wed, 29 May 2013)
New Revision: 635
Url: http://nuiton.org/projects/sandbox/repository/revisions/635
Log:
continue nuitpn-jpa dev
Added:
nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaPersistenceContext.java
Modified:
nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java
nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java
Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java
===================================================================
--- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java 2013-05-27 21:25:49 UTC (rev 634)
+++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java 2013-05-29 08:54:49 UTC (rev 635)
@@ -143,6 +143,51 @@
return query;
}
+ protected <E> TypedQuery<E> createQuery(Class<E> type, String hql) {
+ TypedQuery<E> query = entityManager.createQuery(hql, type);
+ return query;
+ }
+
+ protected <E> TypedQuery<E> createQuery(Class<E> type, String propertyName,
+ Object propertyValue,
+ Object... others) {
+
+ Map<String, Object> properties = new HashMap<String, Object>();
+ properties.put(propertyName, propertyValue);
+ Object name = null;
+ for (int i = 0; i < others.length; ) {
+ try {
+ name = others[i++];
+ propertyValue = others[i++];
+ properties.put((String) name, propertyValue);
+ } catch (ClassCastException eee) {
+ throw new IllegalArgumentException(
+ "Les noms des propriétés doivent être des chaines et " +
+ "non pas " + propertyName.getClass().getName(),
+ eee);
+ } catch (ArrayIndexOutOfBoundsException eee) {
+ throw new IllegalArgumentException(
+ "Le nombre d'argument n'est pas un nombre pair: "
+ + (others.length + 2)
+ + " La dernière propriété était: " + name, eee);
+ }
+ }
+ return createQuery(type, properties);
+ }
+
+ protected <E>TypedQuery<E> createQuery(Class<E> type, Map<String, Object> properties) {
+ List<String> whereClauses = new LinkedList<String>();
+ for (String propertyName : properties.keySet()) {
+ whereClauses.add(propertyName + " = :" + propertyName);
+ }
+ String hql = "from " + getEntityClass().getSimpleName() + " where " + StringUtils.join(whereClauses, " and ");
+ TypedQuery<E> query = createQuery(type, hql);
+ for (Map.Entry<String, Object> property : properties.entrySet()) {
+ query.setParameter(property.getKey(), property.getValue());
+ }
+ return query;
+ }
+
protected TypedQuery<E> createQuery(String hql) {
TypedQuery<E> query = entityManager.createQuery(hql, getEntityClass());
return query;
Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java
===================================================================
--- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java 2013-05-27 21:25:49 UTC (rev 634)
+++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java 2013-05-29 08:54:49 UTC (rev 635)
@@ -34,7 +34,7 @@
* @author tchemit <chemit(a)codelutin.com>
* @since 0.1
*/
-public class AbstractJpaPersistenceContext {
+public class AbstractJpaPersistenceContext implements JpaPersistenceContext {
protected EntityManager entityManager;
@@ -48,15 +48,25 @@
}
}
+ @Override
public void commit() {
entityTransaction.commit();
entityTransaction = entityManager.getTransaction();
entityTransaction.begin();
}
+ @Override
public void rollback() {
entityTransaction.rollback();
entityTransaction = entityManager.getTransaction();
entityTransaction.begin();
}
+
+ public EntityManager getEntityManager() {
+ return entityManager;
+ }
+
+ public EntityTransaction getEntityTransaction() {
+ return entityTransaction;
+ }
}
Added: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaPersistenceContext.java
===================================================================
--- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaPersistenceContext.java (rev 0)
+++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaPersistenceContext.java 2013-05-29 08:54:49 UTC (rev 635)
@@ -0,0 +1,47 @@
+package org.nuiton.jpa.api;
+
+/*
+ * #%L
+ * Nuiton Jpa :: API
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+
+/**
+ * TODO
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @since 0.1
+ */
+public interface JpaPersistenceContext {
+
+ EntityManager getEntityManager();
+
+ EntityTransaction getEntityTransaction();
+
+ void commit();
+
+ void rollback();
+
+
+}
Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaPersistenceContext.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision HeadURL
Added: svn:eol-style
+ native
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-05-27 21:25:49 UTC (rev 634)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-05-29 08:54:49 UTC (rev 635)
@@ -241,7 +241,9 @@
if (PROPERTY_ID.equals(propertyName)) {
addAnnotation(result, property, output, Id.class);
- addAnnotation(result, property, output, GeneratedValue.class);
+ if (!JpaTemplatesGeneratorUtil.hasNotGeneratedValueStereotype(input)) {
+ addAnnotation(result, property, output, GeneratedValue.class);
+ }
continue;
}
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-05-27 21:25:49 UTC (rev 634)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-05-29 08:54:49 UTC (rev 635)
@@ -359,4 +359,17 @@
public static boolean hasUniqueStereotype(ObjectModelAttribute attribute) {
return attribute.hasStereotype(JpaTemplatesStereoTypes.STEREOTYPE_UNIQUE);
}
+
+ /**
+ * Check if the given class has the
+ * {@link JpaTemplatesStereoTypes#STEREOTYPE_NOT_GENERATED_VALUE} stereotype.
+ *
+ * @param clazz class to test
+ * @return {@code true} if stereotype was found, {@code false otherwise}
+ * @see JpaTemplatesStereoTypes#STEREOTYPE_NOT_GENERATED_VALUE
+ * @since 2.5
+ */
+ public static boolean hasNotGeneratedValueStereotype(ObjectModelClass clazz) {
+ return clazz.hasStereotype(JpaTemplatesStereoTypes.STEREOTYPE_NOT_GENERATED_VALUE);
+ }
}
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java 2013-05-27 21:25:49 UTC (rev 634)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java 2013-05-29 08:54:49 UTC (rev 635)
@@ -27,7 +27,10 @@
import org.nuiton.eugene.EugeneStereoTypes;
import org.nuiton.eugene.ModelPropertiesUtil;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
+import org.nuiton.eugene.models.object.ObjectModelClass;
+import javax.persistence.GeneratedValue;
+
/**
* Defines all stereotypes managed by JPA templates.
*
@@ -44,4 +47,13 @@
@ModelPropertiesUtil.StereotypeDefinition(target = ObjectModelAttribute.class,
documentation = "To specify that an attribute is unique (JPA mapping)")
String STEREOTYPE_UNIQUE = "unique";
+
+ /**
+ * Stéréotype pour ne pas générer l' annotation {@link GeneratedValue} sur une entité.
+ *
+ * @see JpaTemplatesGeneratorUtil#hasNotGeneratedValueStereotype(ObjectModelAttribute)
+ */
+ @ModelPropertiesUtil.StereotypeDefinition(target = ObjectModelClass.class,
+ documentation = "To specify that an entity deal by itself with his id, the GeneratedValue annotation will not be generated then(JPA mapping)")
+ String STEREOTYPE_NOT_GENERATED_VALUE = "notGeneratedValue";
}
1
0
r634 - nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates
by tchemit@users.nuiton.org 27 May '13
by tchemit@users.nuiton.org 27 May '13
27 May '13
Author: tchemit
Date: 2013-05-27 23:25:49 +0200 (Mon, 27 May 2013)
New Revision: 634
Url: http://nuiton.org/projects/sandbox/repository/revisions/634
Log:
- add generatedValue on each entity
- review isEntity method
- review where to generate classes
- review dao inheritance layout
Modified:
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java 2013-05-27 11:55:30 UTC (rev 633)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java 2013-05-27 21:25:49 UTC (rev 634)
@@ -58,20 +58,26 @@
String packageName = JpaTemplatesGeneratorUtil.getDaoPackage(this, model, input);
+ String generatedDaoName = JpaTemplatesGeneratorUtil.getDaoGeneratedName(input);
String abstractDaoName = JpaTemplatesGeneratorUtil.getDaoAbstractName(input);
-
String concreteDaoName = JpaTemplatesGeneratorUtil.getDaoConcreteName(input);
String concreteEntityQualifiedName=
JpaTemplatesGeneratorUtil.getConcreteEntityQualifiedName(this, model, input);
+ boolean generateGenerated= !isInClassPath(packageName, generatedDaoName);
boolean generateAbstract = !isInClassPath(packageName, abstractDaoName);
boolean generateConcrete = !isInClassPath(packageName, concreteDaoName);
+ if (generateGenerated) {
+
+ generateGenerated(input, packageName, generatedDaoName, concreteEntityQualifiedName);
+ }
+
if (generateAbstract) {
- generateAbstract(input, packageName, abstractDaoName, concreteEntityQualifiedName);
+ generateAbstract(input, packageName, generatedDaoName, abstractDaoName, concreteEntityQualifiedName);
}
if (generateConcrete) {
@@ -80,7 +86,7 @@
}
}
- protected ObjectModelClass generateAbstract(ObjectModelClass input,
+ protected ObjectModelClass generateGenerated(ObjectModelClass input,
String packageName,
String abstractDaoName,
String concreteEntityQualifiedName) {
@@ -144,12 +150,30 @@
return output;
}
- protected ObjectModelClass generateImpl(ObjectModelClass input,
+ protected ObjectModelClass generateAbstract(ObjectModelClass input,
String packageName,
+ String generatedDaoName,
String abstractDaoName,
- String concreteDaoName,
String concreteEntityQualifiedName) {
+ ObjectModelClass output = createAbstractClass(abstractDaoName+ "<E extends " + input.getName() + ">", packageName);
+
+ setSuperClass(output, packageName + '.' + generatedDaoName + "<E>");
+ addImport(output, concreteEntityQualifiedName);
+ addConstructorWithEntityManager(output);
+
+ if (isVerbose()) {
+ log.info("will generate " + output.getQualifiedName());
+ }
+ return output;
+ }
+
+ protected ObjectModelClass generateImpl(ObjectModelClass input,
+ String packageName,
+ String abstractDaoName,
+ String concreteDaoName,
+ String concreteEntityQualifiedName) {
+
ObjectModelClass output = createClass(concreteDaoName, packageName);
setSuperClass(output, packageName + '.' + abstractDaoName + "<" + input.getName() + ">");
@@ -161,5 +185,4 @@
}
return output;
}
-
}
\ No newline at end of file
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-05-27 11:55:30 UTC (rev 633)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-05-27 21:25:49 UTC (rev 634)
@@ -241,9 +241,7 @@
if (PROPERTY_ID.equals(propertyName)) {
addAnnotation(result, property, output, Id.class);
- if (JpaTemplatesGeneratorUtil.hasGeneratedValueStereotype(input)) {
- addAnnotation(result, property, output, GeneratedValue.class);
- }
+ addAnnotation(result, property, output, GeneratedValue.class);
continue;
}
@@ -260,7 +258,6 @@
if (bidirection) {
-
// compute which is master of relation
String inverseValue = JpaTemplatesGeneratorUtil.getInverseTagValue(property);
if (StringUtils.isNotEmpty(inverseValue)) {
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java 2013-05-27 11:55:30 UTC (rev 633)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java 2013-05-27 21:25:49 UTC (rev 634)
@@ -29,6 +29,8 @@
import org.nuiton.eugene.models.object.ObjectModelOperation;
import org.nuiton.jpa.api.AbstractJpaPersistenceContext;
+import java.util.List;
+
/*{generator option: parentheses = false}*/
/*{generator option: writeString = +}*/
@@ -92,10 +94,11 @@
addConstructorWithEntityManager(output);
// add dao factories
- for (ObjectModelClass aClass : getModel().getClasses()) {
- //FIXME Find a way to exclude none entities classes
-// if (packageName.equals(aClass.getPackageName())) {
+ List<ObjectModelClass> entityClasses =
+ JpaTemplatesGeneratorUtil.getEntityClasses(getModel(), true);
+ for (ObjectModelClass aClass : entityClasses) {
+
// add dao factory method
String daoPackageName = JpaTemplatesGeneratorUtil.getDaoPackage(this, model, aClass);
String daoConcreteName = JpaTemplatesGeneratorUtil.getDaoConcreteName(aClass);
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-05-27 11:55:30 UTC (rev 633)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-05-27 21:25:49 UTC (rev 634)
@@ -24,6 +24,7 @@
* #L%
*/
+import com.google.common.base.Preconditions;
import org.nuiton.eugene.java.JavaGeneratorUtil;
import org.nuiton.eugene.models.object.ObjectModel;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
@@ -32,6 +33,8 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
@@ -44,16 +47,22 @@
*/
public class JpaTemplatesGeneratorUtil extends JavaGeneratorUtil {
+ /**
+ * Tests if the given class is an entity (Need only to be in a entity
+ * package).
+ *
+ * @param input the class to test
+ * @return {@code true} if class is an entity.
+ */
+ public static boolean isEntity(ObjectModelClassifier input) {
+ return input.getPackageName().endsWith(".entity");
+ }
+
public static String getPersistenceContextPackage(AbstractJpaTransformer transformer,
ObjectModel model) {
- String result = getPersistenceContextPackageTagValue(model);
- if (result == null) {
+ String result = transformer.getDefaultPackageName();
- // use default package
- result = transformer.getDefaultPackageName();
- }
-
return result;
}
@@ -61,13 +70,7 @@
ObjectModel model,
ObjectModelClassifier input) {
- String result = getEntityPackageTagValue(model, input);
- if (result == null) {
-
- // use default package
- result = transformer.getDefaultPackageName() + ".entity";
- }
-
+ String result = input.getPackageName();
return result;
}
@@ -75,16 +78,47 @@
ObjectModel model,
ObjectModelClassifier input) {
- String result = getDaoPackageTagValue(model, input);
- if (result == null) {
+ Preconditions.checkState(isEntity(input), "Cant' find dao package name for a none entity " + input);
+ int lastIndexOf = input.getPackageName().lastIndexOf(".entity");
+ String result = input.getPackageName().substring(0, lastIndexOf) + ".dao";
+ return result;
+ }
- // use default package
- result = transformer.getDefaultPackageName() + ".dao";
+ /**
+ * Obtain the list of entities classes with the possibility to sort the
+ * result.
+ *
+ * @param model the current model to scan
+ * @param sort flag to allow sort the result
+ * @return the list of filtred classes by their stereotype
+ */
+ public static List<ObjectModelClass> getEntityClasses(ObjectModel model,
+ boolean sort) {
+ List<ObjectModelClass> classes = new ArrayList<ObjectModelClass>();
+ for (ObjectModelClass clazz : model.getClasses()) {
+ if (isEntity(clazz)) {
+ classes.add(clazz);
+ }
}
+ if (sort && !classes.isEmpty()) {
- return result;
+ Collections.sort(classes, OBJECT_MODEL_CLASS_COMPARATOR);
+ }
+ return classes;
}
+ static public final Comparator<ObjectModelClass>
+ OBJECT_MODEL_CLASS_COMPARATOR =
+ new Comparator<ObjectModelClass>() {
+
+ @Override
+ public int compare(ObjectModelClass o1,
+ ObjectModelClass o2) {
+ return o1.getQualifiedName().compareTo(
+ o2.getQualifiedName());
+ }
+ };
+
public static String getPersistenceContextAbstractName(ObjectModel model) {
return "AbstractJpa" + model.getName() + "PersistenceContext";
}
@@ -105,6 +139,10 @@
return "Abstract" + input.getName() + "JpaDao";
}
+ public static String getDaoGeneratedName(ObjectModelClass input) {
+ return "Generated" + input.getName() + "JpaDao";
+ }
+
public static String getDaoConcreteName(ObjectModelClass input) {
return input.getName() + "JpaDao";
}
@@ -321,17 +359,4 @@
public static boolean hasUniqueStereotype(ObjectModelAttribute attribute) {
return attribute.hasStereotype(JpaTemplatesStereoTypes.STEREOTYPE_UNIQUE);
}
-
- /**
- * Check if the given class has the
- * {@link JpaTemplatesStereoTypes#STEREOTYPE_GENERATED_VALUE} stereotype.
- *
- * @param aClass class to test
- * @return {@code true} if stereotype was found, {@code false otherwise}
- * @see JpaTemplatesStereoTypes#STEREOTYPE_GENERATED_VALUE
- * @since 2.5
- */
- public static boolean hasGeneratedValueStereotype(ObjectModelClassifier aClass) {
- return aClass.hasStereotype(JpaTemplatesStereoTypes.STEREOTYPE_GENERATED_VALUE);
- }
}
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java 2013-05-27 11:55:30 UTC (rev 633)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java 2013-05-27 21:25:49 UTC (rev 634)
@@ -27,10 +27,7 @@
import org.nuiton.eugene.EugeneStereoTypes;
import org.nuiton.eugene.ModelPropertiesUtil;
import org.nuiton.eugene.models.object.ObjectModelAttribute;
-import org.nuiton.eugene.models.object.ObjectModelClassifier;
-import javax.persistence.GeneratedValue;
-
/**
* Defines all stereotypes managed by JPA templates.
*
@@ -47,13 +44,4 @@
@ModelPropertiesUtil.StereotypeDefinition(target = ObjectModelAttribute.class,
documentation = "To specify that an attribute is unique (JPA mapping)")
String STEREOTYPE_UNIQUE = "unique";
-
- /**
- * Stéréotype pour ajouter l'annoation {@link GeneratedValue} sur l'id.
- *
- * @see JpaTemplatesGeneratorUtil#hasGeneratedValueStereotype(ObjectModelClassifier)
- */
- @ModelPropertiesUtil.StereotypeDefinition(target = ObjectModelClassifier.class,
- documentation = "To specify that an entity has a generated id (see GeneratedValue annotation) (JPA mapping)")
- String STEREOTYPE_GENERATED_VALUE = "generatedValue";
}
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java 2013-05-27 11:55:30 UTC (rev 633)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java 2013-05-27 21:25:49 UTC (rev 634)
@@ -53,7 +53,7 @@
/**
* Tag value to specify where to generate entities.
*
- * @see JpaTemplatesGeneratorUtil#getEntityPackage(ObjectModel)
+ * @see JpaTemplatesGeneratorUtil#getEntityPackageTagValue(ObjectModel, ObjectModelClassifier)
* @since 0.1
*/
@ModelPropertiesUtil.TagValueDefinition(
@@ -76,7 +76,7 @@
/**
* Tag value to specify where to generate daos.
*
- * @see JpaTemplatesGeneratorUtil#getDaoPackage(ObjectModel)
+ * @see JpaTemplatesGeneratorUtil#getDaoPackageTagValue(ObjectModel, ObjectModelClassifier)
* @since 0.1
*/
@ModelPropertiesUtil.TagValueDefinition(
@@ -96,9 +96,9 @@
String TAG_PERSISTENCE_CONTEXT_SUPER_CLASS = "persistenceContextSuperClass";
/**
- * Tag value to specify where to generate persistenceContexts.
+ * Tag value to specify where to generate persistenceContext.
*
- * @see JpaTemplatesGeneratorUtil#getPersistenceContextPackage(ObjectModel)
+ * @see JpaTemplatesGeneratorUtil#getPersistenceContextPackageTagValue(ObjectModel)
* @since 0.1
*/
@ModelPropertiesUtil.TagValueDefinition(
1
0
r633 - nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates
by tchemit@users.nuiton.org 27 May '13
by tchemit@users.nuiton.org 27 May '13
27 May '13
Author: tchemit
Date: 2013-05-27 13:55:30 +0200 (Mon, 27 May 2013)
New Revision: 633
Url: http://nuiton.org/projects/sandbox/repository/revisions/633
Log:
fix dao implements
Modified:
nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java
Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java
===================================================================
--- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java 2013-05-27 11:53:32 UTC (rev 632)
+++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java 2013-05-27 11:55:30 UTC (rev 633)
@@ -119,6 +119,15 @@
addConstructorWithEntityManager(output);
+ // detect if there is a contract to set on abstract
+ String daoContractName = packageName + "." + input.getName() + "Dao";
+
+ boolean addUserDaoContract = isInClassPath(daoContractName);
+
+ if (addUserDaoContract) {
+ addInterface(output, daoContractName);
+ }
+
// Add getEntityClass
ObjectModelOperation operation = addOperation(output, "getEntityClass", "Class<E>", ObjectModelJavaModifier.PROTECTED);
@@ -147,15 +156,6 @@
addImport(output, concreteEntityQualifiedName);
addConstructorWithEntityManager(output);
- // detect if there is a contract to set on abstract
- String daoContractName = packageName + "." + input.getName() + "Dao";
-
- boolean addUserDaoContract = isInClassPath(daoContractName);
-
- if (addUserDaoContract) {
- addInterface(output, daoContractName);
- }
-
if (isVerbose()) {
log.info("will generate " + output.getQualifiedName());
}
1
0
r632 - nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api
by bleny@users.nuiton.org 27 May '13
by bleny@users.nuiton.org 27 May '13
27 May '13
Author: bleny
Date: 2013-05-27 13:53:32 +0200 (Mon, 27 May 2013)
New Revision: 632
Url: http://nuiton.org/projects/sandbox/repository/revisions/632
Log:
remove duplicate line
Modified:
nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java
Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java
===================================================================
--- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java 2013-05-26 06:51:26 UTC (rev 631)
+++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java 2013-05-27 11:53:32 UTC (rev 632)
@@ -42,7 +42,6 @@
public AbstractJpaPersistenceContext(EntityManager entityManager) {
this.entityManager = entityManager;
- this.entityManager = entityManager;
entityTransaction = entityManager.getTransaction();
if (!entityTransaction.isActive()) {
entityTransaction.begin();
1
0
Author: tchemit
Date: 2013-05-26 08:51:26 +0200 (Sun, 26 May 2013)
New Revision: 631
Url: http://nuiton.org/projects/sandbox/repository/revisions/631
Log:
updates mavenpom to 3.4.11
Modified:
nuiton-jpa/pom.xml
Modified: nuiton-jpa/pom.xml
===================================================================
--- nuiton-jpa/pom.xml 2013-05-25 15:09:41 UTC (rev 630)
+++ nuiton-jpa/pom.xml 2013-05-26 06:51:26 UTC (rev 631)
@@ -7,7 +7,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmineAndCentral</artifactId>
- <version>3.4.10</version>
+ <version>3.4.11</version>
</parent>
<artifactId>nuiton-jpa</artifactId>
1
0
r630 - in nuiton-jpa/nuiton-jpa-templates/src/it/magalie: . src src/main
by tchemit@users.nuiton.org 25 May '13
by tchemit@users.nuiton.org 25 May '13
25 May '13
Author: tchemit
Date: 2013-05-25 17:09:41 +0200 (Sat, 25 May 2013)
New Revision: 630
Url: http://nuiton.org/projects/sandbox/repository/revisions/630
Log:
add missing svn externals\!
Added:
nuiton-jpa/nuiton-jpa-templates/src/it/magalie/src/
nuiton-jpa/nuiton-jpa-templates/src/it/magalie/src/main/
Property changes on: nuiton-jpa/nuiton-jpa-templates/src/it/magalie/src/main
___________________________________________________________________
Added: svn:externals
+ http://svn.forge.codelutin.com/svn/franciaflex-magalie/branches/magalie-eug… xmi
1
0