r626 - in nuiton-jpa: . nuiton-jpa-api nuiton-jpa-api/src nuiton-jpa-api/src/license nuiton-jpa-api/src/main/java/org/nuiton/jpa/api nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/hibernate nuiton-jpa-junit nuiton-jpa-junit/src nuiton-jpa-junit/src/license nuiton-jpa-junit/src/main/java/org/nuiton/jpa/junit nuiton-jpa-templates nuiton-jpa-templates/src nuiton-jpa-templates/src/license nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates nuiton-jpa-templates/src/main/resources nuito
Author: tchemit Date: 2013-05-25 00:14:35 +0200 (Sat, 25 May 2013) New Revision: 626 Url: http://nuiton.org/projects/sandbox/repository/revisions/626 Log: nuiton-jpa first templates (works on magalie) Added: nuiton-jpa/nuiton-jpa-api/src/license/ nuiton-jpa/nuiton-jpa-api/src/license/THIRD-PARTY.properties nuiton-jpa/nuiton-jpa-junit/src/license/ nuiton-jpa/nuiton-jpa-junit/src/license/THIRD-PARTY.properties nuiton-jpa/nuiton-jpa-templates/src/license/ nuiton-jpa/nuiton-jpa-templates/src/license/THIRD-PARTY.properties nuiton-jpa/nuiton-jpa-templates/src/main/resources/META-INF/ nuiton-jpa/nuiton-jpa-templates/src/main/resources/META-INF/services/ nuiton-jpa/nuiton-jpa-templates/src/main/resources/META-INF/services/org.nuiton.eugene.ModelPropertiesUtil$ModelPropertiesProvider Modified: nuiton-jpa/LICENSE.txt nuiton-jpa/README.txt nuiton-jpa/changelog.txt nuiton-jpa/nuiton-jpa-api/LICENSE.txt nuiton-jpa/nuiton-jpa-api/README.txt nuiton-jpa/nuiton-jpa-api/changelog.txt nuiton-jpa/nuiton-jpa-api/pom.xml 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/AbstractJpaEntity.java 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/JpaDao.java nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/hibernate/HibernateUtil.java nuiton-jpa/nuiton-jpa-junit/LICENSE.txt nuiton-jpa/nuiton-jpa-junit/README.txt nuiton-jpa/nuiton-jpa-junit/changelog.txt nuiton-jpa/nuiton-jpa-junit/pom.xml nuiton-jpa/nuiton-jpa-junit/src/main/java/org/nuiton/jpa/junit/JpaEntityManagerRule.java nuiton-jpa/nuiton-jpa-templates/LICENSE.txt nuiton-jpa/nuiton-jpa-templates/README.txt nuiton-jpa/nuiton-jpa-templates/changelog.txt nuiton-jpa/nuiton-jpa-templates/pom.xml nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/AbstractJpaTransformer.java 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/JpaTemplatesModelPropertiesProvider.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 nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/package-info.java nuiton-jpa/pom.xml Modified: nuiton-jpa/LICENSE.txt =================================================================== --- nuiton-jpa/LICENSE.txt 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/LICENSE.txt 2013-05-24 22:14:35 UTC (rev 626) @@ -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. + Property changes on: nuiton-jpa/LICENSE.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Property changes on: nuiton-jpa/README.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Property changes on: nuiton-jpa/changelog.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: nuiton-jpa/nuiton-jpa-api/LICENSE.txt =================================================================== --- nuiton-jpa/nuiton-jpa-api/LICENSE.txt 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-api/LICENSE.txt 2013-05-24 22:14:35 UTC (rev 626) @@ -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. + Property changes on: nuiton-jpa/nuiton-jpa-api/LICENSE.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Property changes on: nuiton-jpa/nuiton-jpa-api/README.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Property changes on: nuiton-jpa/nuiton-jpa-api/changelog.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: nuiton-jpa/nuiton-jpa-api/pom.xml =================================================================== --- nuiton-jpa/nuiton-jpa-api/pom.xml 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-api/pom.xml 2013-05-24 22:14:35 UTC (rev 626) @@ -31,11 +31,6 @@ </dependency> <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - </dependency> - - <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> Property changes on: nuiton-jpa/nuiton-jpa-api/pom.xml ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Added: nuiton-jpa/nuiton-jpa-api/src/license/THIRD-PARTY.properties =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/license/THIRD-PARTY.properties (rev 0) +++ nuiton-jpa/nuiton-jpa-api/src/license/THIRD-PARTY.properties 2013-05-24 22:14:35 UTC (rev 626) @@ -0,0 +1,21 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - Apache License 2.0 +# - BSD License +# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 +# - GNU Lesser General Public License, version 2.1 +# - Indiana University Extreme! Lab Software License, vesion 1.1.1 +# - Lesser General Public License (LPGL) +# - Lesser General Public License (LPGL) v 2.1 +# - MIT License +# - MPL 1.1 +# - The Apache Software License, Version 2.0 +# - The H2 License, Version 1.0 +# - license.txt +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sat May 25 00:05:21 CEST 2013 +dom4j--dom4j--1.6.1=BSD License Property changes on: nuiton-jpa/nuiton-jpa-api/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native 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-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java 2013-05-24 22:14:35 UTC (rev 626) @@ -3,23 +3,24 @@ /* * #%L * MagaLiE :: Persistence - * $Id:$ - * $HeadURL:$ + * $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 Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * 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 Public License for more details. + * GNU General Lesser Public License for more details. * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * 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% */ Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaDao.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaEntity.java =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaEntity.java 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaEntity.java 2013-05-24 22:14:35 UTC (rev 626) @@ -3,23 +3,24 @@ /* * #%L * MagaLiE :: Persistence - * $Id:$ - * $HeadURL:$ + * $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 Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * 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 Public License for more details. + * GNU General Lesser Public License for more details. * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * 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% */ Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaEntity.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native 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-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java 2013-05-24 22:14:35 UTC (rev 626) @@ -1,5 +1,32 @@ package org.nuiton.jpa.api; +/* + * #%L + * nuiton-jpa-api + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 20013 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 * @@ -7,4 +34,29 @@ * @since 0.1 */ public class AbstractJpaPersistenceContext { + + protected EntityManager entityManager; + + protected EntityTransaction entityTransaction; + + public AbstractJpaPersistenceContext(EntityManager entityManager) { + this.entityManager = entityManager; + this.entityManager = entityManager; + entityTransaction = entityManager.getTransaction(); + if (!entityTransaction.isActive()) { + entityTransaction.begin(); + } + } + + public void commit() { + entityTransaction.commit(); + entityTransaction = entityManager.getTransaction(); + entityTransaction.begin(); + } + + public void rollback() { + entityTransaction.rollback(); + entityTransaction = entityManager.getTransaction(); + entityTransaction.begin(); + } } Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/AbstractJpaPersistenceContext.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaDao.java =================================================================== --- nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaDao.java 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaDao.java 2013-05-24 22:14:35 UTC (rev 626) @@ -3,23 +3,24 @@ /* * #%L * MagaLiE :: Persistence - * $Id:$ - * $HeadURL:$ + * $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 Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * 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 Public License for more details. + * GNU General Lesser Public License for more details. * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * 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% */ Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/JpaDao.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native 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-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/hibernate/HibernateUtil.java 2013-05-24 22:14:35 UTC (rev 626) @@ -1,5 +1,29 @@ package org.nuiton.jpa.api.hibernate; +/* + * #%L + * nuiton-jpa-api + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 20013 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.SystemUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Property changes on: nuiton-jpa/nuiton-jpa-api/src/main/java/org/nuiton/jpa/api/hibernate/HibernateUtil.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: nuiton-jpa/nuiton-jpa-junit/LICENSE.txt =================================================================== --- nuiton-jpa/nuiton-jpa-junit/LICENSE.txt 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-junit/LICENSE.txt 2013-05-24 22:14:35 UTC (rev 626) @@ -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. + Property changes on: nuiton-jpa/nuiton-jpa-junit/LICENSE.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Property changes on: nuiton-jpa/nuiton-jpa-junit/README.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Property changes on: nuiton-jpa/nuiton-jpa-junit/changelog.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: nuiton-jpa/nuiton-jpa-junit/pom.xml =================================================================== --- nuiton-jpa/nuiton-jpa-junit/pom.xml 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-junit/pom.xml 2013-05-24 22:14:35 UTC (rev 626) @@ -27,6 +27,16 @@ <scope>provided</scope> </dependency> + <dependency> + <groupId>org.hibernate.javax.persistence</groupId> + <artifactId>hibernate-jpa-2.0-api</artifactId> + </dependency> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </dependency> + </dependencies> <build> Property changes on: nuiton-jpa/nuiton-jpa-junit/pom.xml ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Added: nuiton-jpa/nuiton-jpa-junit/src/license/THIRD-PARTY.properties =================================================================== --- nuiton-jpa/nuiton-jpa-junit/src/license/THIRD-PARTY.properties (rev 0) +++ nuiton-jpa/nuiton-jpa-junit/src/license/THIRD-PARTY.properties 2013-05-24 22:14:35 UTC (rev 626) @@ -0,0 +1,24 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - Apache License 2.0 +# - BSD License +# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 +# - Common Public License Version 1.0 +# - GNU Lesser General Public License, version 2.1 +# - Indiana University Extreme! Lab Software License, vesion 1.1.1 +# - Lesser General Public License (LGPL) v 3.0 +# - Lesser General Public License (LPGL) +# - Lesser General Public License (LPGL) v 2.1 +# - MIT License +# - MPL 1.1 +# - New BSD License +# - The Apache Software License, Version 2.0 +# - The H2 License, Version 1.0 +# - license.txt +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sat May 25 00:06:28 CEST 2013 +dom4j--dom4j--1.6.1=BSD License Property changes on: nuiton-jpa/nuiton-jpa-junit/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: nuiton-jpa/nuiton-jpa-junit/src/main/java/org/nuiton/jpa/junit/JpaEntityManagerRule.java =================================================================== --- nuiton-jpa/nuiton-jpa-junit/src/main/java/org/nuiton/jpa/junit/JpaEntityManagerRule.java 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-junit/src/main/java/org/nuiton/jpa/junit/JpaEntityManagerRule.java 2013-05-24 22:14:35 UTC (rev 626) @@ -3,23 +3,24 @@ /* * #%L * MagaLiE :: Services - * $Id:$ - * $HeadURL:$ + * $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 Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * 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 Public License for more details. + * GNU General Lesser Public License for more details. * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. + * 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% */ Property changes on: nuiton-jpa/nuiton-jpa-junit/src/main/java/org/nuiton/jpa/junit/JpaEntityManagerRule.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: nuiton-jpa/nuiton-jpa-templates/LICENSE.txt =================================================================== --- nuiton-jpa/nuiton-jpa-templates/LICENSE.txt 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/LICENSE.txt 2013-05-24 22:14:35 UTC (rev 626) @@ -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. + Property changes on: nuiton-jpa/nuiton-jpa-templates/LICENSE.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Property changes on: nuiton-jpa/nuiton-jpa-templates/README.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Property changes on: nuiton-jpa/nuiton-jpa-templates/changelog.txt ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: nuiton-jpa/nuiton-jpa-templates/pom.xml =================================================================== --- nuiton-jpa/nuiton-jpa-templates/pom.xml 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/pom.xml 2013-05-24 22:14:35 UTC (rev 626) @@ -29,13 +29,13 @@ </dependency> <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> </dependency> <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> </dependency> <dependency> @@ -63,7 +63,52 @@ <build> + <plugins> + <plugin> + <groupId>org.nuiton.processor</groupId> + <artifactId>processor-maven-plugin</artifactId> + </plugin> + <!-- expose new plexus components --> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + <executions> + <execution> + <goals> + <goal>generate-metadata</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + <profiles> + + <!-- reporting at release time --> + <profile> + <id>reporting</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + + <reporting> + <plugins> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-maven-plugin</artifactId> + <version>${plexusPluginVersion}</version> + </plugin> + + </plugins> + </reporting> + + </profile> + </profiles> + </project> Property changes on: nuiton-jpa/nuiton-jpa-templates/pom.xml ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Added: nuiton-jpa/nuiton-jpa-templates/src/license/THIRD-PARTY.properties =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/license/THIRD-PARTY.properties (rev 0) +++ nuiton-jpa/nuiton-jpa-templates/src/license/THIRD-PARTY.properties 2013-05-24 22:14:35 UTC (rev 626) @@ -0,0 +1,30 @@ +# Generated by org.codehaus.mojo.license.AddThirdPartyMojo +#------------------------------------------------------------------------------- +# Already used licenses in project : +# - Apache License 2.0 +# - Apache License Version 2.0 +# - BSD License +# - COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 +# - Common Public License Version 1.0 +# - GNU Lesser General Public License, version 2.1 +# - Indiana University Extreme! Lab Software License, vesion 1.1.1 +# - Lesser General Public License (LGPL) v 3.0 +# - Lesser General Public License (LPGL) +# - Lesser General Public License (LPGL) v 2.1 +# - MIT License +# - MPL 1.1 +# - Mozilla Public License Version 1.0 +# - New BSD License +# - The Apache Software License, Version 2.0 +# - The H2 License, Version 1.0 +# - The SAX License +# - The W3C License +# - http://jaxen.codehaus.org/license.html +# - license.txt +#------------------------------------------------------------------------------- +# Please fill the missing licenses for dependencies : +# +# +#Sat May 25 00:06:31 CEST 2013 +commons-primitives--commons-primitives--1.0=The Apache Software License, Version 2.0 +dom4j--dom4j--1.6.1=BSD License Property changes on: nuiton-jpa/nuiton-jpa-templates/src/license/THIRD-PARTY.properties ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/AbstractJpaTransformer.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/AbstractJpaTransformer.java 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/AbstractJpaTransformer.java 2013-05-24 22:14:35 UTC (rev 626) @@ -4,7 +4,7 @@ * #%L * EUGene :: JPA templates * $Id$ - * $HeadURL: http://svn.nuiton.org/svn/eugene/trunk/eugene-jpa-templates/src/main/java/or... $ + * $HeadURL$ * %% * Copyright (C) 2013 CodeLutin, Tony Chemit * %% @@ -35,6 +35,7 @@ import org.nuiton.eugene.models.object.ObjectModelJavaModifier; import org.nuiton.eugene.models.object.ObjectModelOperation; +import javax.persistence.EntityManager; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.io.Serializable; @@ -54,6 +55,21 @@ public static final String DEFAULT_CONSTANT_PREFIX = "PROPERTY_"; + protected void addConstructorWithEntityManager(ObjectModelClass output) { + + ObjectModelOperation constructor = addConstructor( + output, + ObjectModelJavaModifier.PUBLIC); + + addParameter(constructor, EntityManager.class, "entityManager"); + + setOperationBody(constructor, "" + /*{ + super(entityManager); + }*/ + ); + } + protected boolean isInClassPath(String packageName, String className) { return isInClassPath(packageName + "." + className); @@ -74,6 +90,16 @@ return superClassIsBean; } + protected boolean isEntity(ObjectModelClass input, String type) { + + ObjectModelClass aClass = getModel().getClass(type); + + // test if a super class is in same package (so is another entity) + boolean result = aClass != null && + input.getPackageName().equals(aClass.getPackageName()); + return result; + } + protected void createPropertyConstant(ObjectModelClass output, ObjectModelAttribute attr, String prefix, @@ -128,7 +154,6 @@ } - protected List<ObjectModelAttribute> getProperties(ObjectModelClass input) { List<ObjectModelAttribute> attributes = (List<ObjectModelAttribute>) input.getAttributes(); @@ -251,7 +276,7 @@ "void", ObjectModelJavaModifier.PUBLIC ); - addParameter(operation, "java.util.Collection<" + attrType + ">", attrName); + addParameter(operation, Collection.class.getName() + "<" + attrType + ">", attrName); String methodName = getJavaBeanMethodName("get", attrName); StringBuilder buffer = new StringBuilder("" @@ -375,7 +400,7 @@ "boolean", ObjectModelJavaModifier.PUBLIC ); - addParameter(operation, "java.util.Collection<" + attrType + ">", attrName); + addParameter(operation, Collection.class.getName() + "<" + attrType + ">", attrName); StringBuilder buffer = new StringBuilder(); String methodName = getJavaBeanMethodName("get", attrName); buffer.append("" @@ -563,7 +588,7 @@ addParameter(getChild, "java.util.Collection<T>", "childs"); addParameter(getChild, "int", "index"); setOperationBody(getChild, "" -/*{ + /*{ T result = null; if (childs != null) { if (childs instanceof List) { @@ -582,7 +607,7 @@ } } return result; -}*/ + }*/ ); } } Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/AbstractJpaTransformer.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL 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-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java 2013-05-24 22:14:35 UTC (rev 626) @@ -4,7 +4,7 @@ * #%L * EUGene :: JPA templates * $Id$ - * $HeadURL: http://svn.nuiton.org/svn/eugene/trunk/eugene-jpa-templates/src/main/java/or... $ + * $HeadURL$ * %% * Copyright (C) 2013 CodeLutin * %% @@ -31,12 +31,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; 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.AbstractJpaDao; -import javax.persistence.EntityManager; - /** * JpaDaoTransformer generates a dao for an entity. * <p/> @@ -48,23 +45,20 @@ * {@code Note:} All classes found in class-path are not generated. * * @author tchemit <chemit@codelutin.com> - * @plexus.component role="org.nuiton.eugene.Template" role-hint="org.nuiton.eugene.jpa.JpaDaoTransformer" + * @plexus.component role="org.nuiton.eugene.Template" role-hint="org.nuiton.jpa.templates.JpaDaoTransformer" * @since 0.1 */ public class JpaDaoTransformer extends AbstractJpaTransformer { private static final Log log = LogFactory.getLog(JpaDaoTransformer.class); - protected String getConcreteName(ObjectModelClass input) { - return input.getName() + "JpaDao"; - } @Override public void transformFromClass(ObjectModelClass input) { String entityAbstractName = "Abstract" + input.getName() + "JpaDao"; - String entityConcreteName = getConcreteName(input); + String entityConcreteName = JpaTemplatesGeneratorUtil.getDaoConcreteName(input); boolean generateAbstract = !isInClassPath(input.getPackageName(), entityAbstractName); @@ -79,13 +73,19 @@ if (generateConcrete) { - generateImpl(input, entityConcreteName); + generateImpl(input, entityAbstractName, entityConcreteName); } } protected ObjectModelClass generateAbstract(ObjectModelClass input, String entityAbstractName) { + String packageName = input.getPackageName(); + + ObjectModelClass output = + createAbstractClass(entityAbstractName + "<E extends " + input.getName() + ">", packageName); + addImport(output, input.getQualifiedName()); + // test if a super class is in same package (so is yet another entity) boolean superClassIsEntity = isSuperClassEntity(input); @@ -95,7 +95,7 @@ // get first super-class ObjectModelClass superClassModel = input.getSuperclasses().iterator().next(); - superClass = getConcreteName(superClassModel); + superClass = JpaTemplatesGeneratorUtil.getDaoConcreteName(superClassModel); } else { @@ -106,37 +106,34 @@ if (superClass == null) { // no super-class, use default one - superClass = AbstractJpaDao.class.getName(); + superClass = AbstractJpaDao.class.getName() + "<E>"; + addImport(output, superClass); } } // detect if there is a contract to set on abstract - String packageName = input.getPackageName(); - String daoContractName = input.getPackageName() + "." + input.getName() + "Dao"; boolean addUserDaoContract = isInClassPath(daoContractName); - ObjectModelClass output = - createAbstractClass(entityAbstractName, packageName); - setSuperClass(output, superClass); if (addUserDaoContract) { addInterface(output, daoContractName); } - addConstructor(output); + addConstructorWithEntityManager(output); // Add getEntityClass if (log.isDebugEnabled()) { log.debug("will generate " + output.getQualifiedName()); } - ObjectModelOperation operation = addOperation(output, "getEntityClass", "Class<" + input.getName() + ">"); + ObjectModelOperation operation = addOperation(output, "getEntityClass", "Class<E>"); + addAnnotation(output, operation, Override.class.getSimpleName()); setOperationBody(operation, "" /*{ - return <%=input.getName()%>.class; + return (Class<E>) <%=input.getName()%>.class; }*/ ); @@ -145,6 +142,7 @@ } protected ObjectModelClass generateImpl(ObjectModelClass input, + String entityAbstractName, String entityConcreteName) { ObjectModelClass output = createClass( @@ -153,10 +151,11 @@ ); // set the abstract resulClass as the resultClassImpl super class - setSuperClass(output, input.getQualifiedName()); + setSuperClass(output, input.getPackageName() + '.' + entityAbstractName + "<" + input.getName() + ">"); + addImport(output, input); + addConstructorWithEntityManager(output); + output.getSuperclasses(); - addConstructor(output); - if (log.isDebugEnabled()) { log.debug("will generate " + output.getQualifiedName()); } @@ -164,12 +163,4 @@ return output; } - protected void addConstructor(ObjectModelClass output) { - - ObjectModelOperation constructor = addConstructor( - output, - ObjectModelJavaModifier.PUBLIC); - - addParameter(constructor, EntityManager.class, "entityManager"); - } } \ No newline at end of file Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaDaoTransformer.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + 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-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java 2013-05-24 22:14:35 UTC (rev 626) @@ -4,7 +4,7 @@ * #%L * EUGene :: JPA templates * $Id$ - * $HeadURL: http://svn.nuiton.org/svn/eugene/trunk/eugene-jpa-templates/src/main/java/or... $ + * $HeadURL$ * %% * Copyright (C) 2013 CodeLutin, Tony Chemit * %% @@ -24,6 +24,7 @@ * #L% */ +import com.google.common.base.Preconditions; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; import org.apache.commons.logging.Log; @@ -36,8 +37,17 @@ import org.nuiton.jpa.api.AbstractJpaEntity; import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.OrderColumn; import java.util.Collection; +import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -53,8 +63,9 @@ * <p/> * {@code Note:} All classes found in class-path are not generated. * + * TODO Deal with @GeneratedValue * @author tchemit <chemit@codelutin.com> - * @plexus.component role="org.nuiton.eugene.Template" role-hint="org.nuiton.eugene.jpa.JpaEntityTransformer" + * @plexus.component role="org.nuiton.eugene.Template" role-hint="org.nuiton.jpa.templates.JpaEntityTransformer" * @since 0.1 */ public class JpaEntityTransformer extends AbstractJpaTransformer { @@ -84,7 +95,7 @@ if (generateConcrete) { - generateImpl(input, entityConcreteName); + generateImpl(input, entityAbstractName, entityConcreteName); } } @@ -138,7 +149,8 @@ setSuperClass(output, superClass); // Add annotation MappedSuperclass - addAnnotation(output, output, MappedSuperclass.class.getName()); + addAnnotation(output, output, MappedSuperclass.class.getSimpleName()); + addImport(output, MappedSuperclass.class); if (log.isDebugEnabled()) { log.debug("will generate " + output.getQualifiedName()); @@ -161,6 +173,7 @@ // Get available properties List<ObjectModelAttribute> properties = getProperties(input); + //TODO Deal with @GeneratedValue ObjectModelAttributeImpl idAttr = new ObjectModelAttributeImpl(); idAttr.setDeclaringElement(input); idAttr.setName("id"); @@ -177,9 +190,8 @@ //TODO Si ORDERED ajouter l'annotation @OrderColumn //TODO Si enumeration @Enumeration(value = EnumType.STRING) (Voir pour mettre une tag-value pour mettre en ordinal) + voir comment ça marche pour les collections - //TODO Generate Persistence annotations Multimap<ObjectModelAttribute, String> annotationsForAttributes = - generateAnnotationsForProperties(); + generateAnnotationsForProperties(input, output, properties); // Add properties constant @@ -202,17 +214,100 @@ // add getChild methods createGetChildMethod(output); - - } return output; } - protected Multimap<ObjectModelAttribute, String> generateAnnotationsForProperties() { - return ArrayListMultimap.create(); + protected Multimap<ObjectModelAttribute, String> generateAnnotationsForProperties(ObjectModelClass input, + ObjectModelClass output, + List<ObjectModelAttribute> properties) { + ArrayListMultimap<ObjectModelAttribute, String> result = + ArrayListMultimap.create(); + + for (ObjectModelAttribute property : properties) { + String propertyName = property.getName(); + String propertyType = property.getType(); + if ("id".equals(propertyName)) { + + result.put(property, Id.class.getSimpleName()); + addImport(output, Id.class); + continue; + } + + ObjectModelAttribute reverseAttribute = + property.getReverseAttribute(); + + boolean nMultiplicity = reverseAttribute != null && + JpaTemplatesGeneratorUtil.isNMultiplicity(reverseAttribute); + + boolean bidirection = reverseAttribute != null && + reverseAttribute.isNavigable(); + + //TODO Deal with bidirection + Preconditions.checkState( + !bidirection, + "Still can not deal with bidirection, but found one " + input.getQualifiedName() + "#" + propertyName); + + boolean entity = isEntity(input, propertyType); + boolean enumeration = getModel().getEnumeration(propertyType) != null; + + if (JpaTemplatesGeneratorUtil.isNMultiplicity(property)) { + + if (nMultiplicity) { + + // * -> * (ManyToMany) + result.put(property, ManyToMany.class.getSimpleName()); + addImport(output, ManyToMany.class); + } else { + + // 0..1 -> * (OneToMany) + result.put(property, OneToMany.class.getSimpleName()); + addImport(output, OneToMany.class); + } + + boolean withOrdererStereotype = property.isOrdered() || + JpaTemplatesGeneratorUtil.hasOrderedStereotype(property); + + if (withOrdererStereotype) { + result.put(property, OrderColumn.class.getSimpleName()); + addImport(output, OrderColumn.class); + } + continue; + } + + if (enumeration) { + + // is an enumeration + result.put(property, Enumerated.class.getSimpleName() + "( value = " + EnumType.class.getSimpleName() + "." + EnumType.STRING + ")"); + addImport(output, Enumerated.class); + addImport(output, EnumType.class); + } + + if (entity) { + + if (nMultiplicity) { + + // * -> 0..1 (ManyToOne) + result.put(property, ManyToOne.class.getSimpleName()); + addImport(output, ManyToOne.class); + } else { + + // 0..1 -> 0..1 (OneToOne) + result.put(property, OneToOne.class.getSimpleName()); + addImport(output, OneToOne.class); + } + + continue; + } + + // simple property + // no annotation + } + return result; } protected ObjectModelClass generateImpl(ObjectModelClass input, + String entityAbstractName, String entityConcreteName) { ObjectModelClass output = createClass( @@ -221,10 +316,11 @@ ); // set the abstract resulClass as the resultClassImpl super class - setSuperClass(output, input.getQualifiedName()); + setSuperClass(output, entityAbstractName); // add Entity annotation - addAnnotation(output, output, Entity.class.getName()); + addAnnotation(output, output, Entity.class.getSimpleName()); + addImport(output, Entity.class); // add a fix serialVersionUID, since the class has no field nor method addConstant(output, @@ -308,11 +404,27 @@ usePCS ); + boolean ordered = attr.isOrdered() || + JpaTemplatesGeneratorUtil.hasOrderedStereotype(attr); + boolean unique = JpaTemplatesGeneratorUtil.hasUniqueStereotype(attr); + // Change type for Multiple attribute - if (attr.isOrdered()) { - attrType = List.class.getName() + "<" + attrType + ">"; + if (ordered) { + + if (unique) { + + attrType = LinkedHashSet.class.getName() + "<" + attrType + ">"; + } else { + + attrType = List.class.getName() + "<" + attrType + ">"; + } } else { - attrType = Collection.class.getName() + "<" + attrType + ">"; + + if (unique) { + attrType = Set.class.getName() + "<" + attrType + ">"; + } else { + attrType = Collection.class.getName() + "<" + attrType + ">"; + } } simpleType = JpaTemplatesGeneratorUtil.getSimpleName(attrType); Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaEntityTransformer.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL 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-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java 2013-05-24 22:14:35 UTC (rev 626) @@ -1,16 +1,98 @@ package org.nuiton.jpa.templates; +/* + * #%L + * nuiton-jpa-templates + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 20013 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.nuiton.eugene.models.object.ObjectModel; +import org.nuiton.eugene.models.object.ObjectModelClass; +import org.nuiton.eugene.models.object.ObjectModelOperation; +import org.nuiton.jpa.api.AbstractJpaPersistenceContext; + +/*{generator option: parentheses = false}*/ +/*{generator option: writeString = +}*/ + /** - * TODO entityManager (constructor + getter) - * TODO dao factory (une méthode par dao) - * TODO commit/rollback * TODO Liste des entités (A voir meta-modèle...) - * TODO Se servir d'un AbstractJpaPersistenceContext * * @author tchemit <chemit@codelutin.com> - * @plexus.component role="org.nuiton.eugene.Template" role-hint="org.nuiton.eugene.jpa.JpaPersistenceContextTransformer" + * @plexus.component role="org.nuiton.eugene.Template" role-hint="org.nuiton.jpa.templates.JpaPersistenceContextTransformer" * @since 0.1 */ -public class JpaPersistenceContextTransformer { +public class JpaPersistenceContextTransformer extends AbstractJpaTransformer { + @Override + public void transformFromModel(ObjectModel model) { + + String className = "Jpa" + model.getName() + "PersistenceContext"; + + String packageName = + getOutputProperties().getProperty(PROP_DEFAULT_PACKAGE); + + boolean generateAbstract = !isInClassPath(packageName, className); + + if (generateAbstract) { + + generate(packageName, className); + } + } + + protected void generate(String packageName, String className) { + + // try to find a super class by tag-value + String superClass = JpaTemplatesGeneratorUtil.getPersistenceContextSuperClassTagValue( + model); + + if (superClass == null) { + + // no super-class, use default one + superClass = AbstractJpaPersistenceContext.class.getName(); + } + + ObjectModelClass output = createClass(className, packageName); + + setSuperClass(output, superClass); + + addConstructorWithEntityManager(output); + + for (ObjectModelClass aClass : getModel().getClasses()) { + if (packageName.equals(aClass.getPackageName())) { + + // add dao factory method + String daoConcreteName = JpaTemplatesGeneratorUtil.getDaoConcreteName(aClass); + + ObjectModelOperation operation = addOperation( + output, + "get" + daoConcreteName, + packageName + "." + daoConcreteName); + setOperationBody(operation, "" + /*{ + return new <%=daoConcreteName%>(entityManager); + }*/ + ); + + } + } + + } } Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaPersistenceContextTransformer.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL 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-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java 2013-05-24 22:14:35 UTC (rev 626) @@ -4,7 +4,7 @@ * #%L * EUGene :: JPA templates * $Id$ - * $HeadURL: http://svn.nuiton.org/svn/eugene/trunk/eugene-jpa-templates/src/main/java/or... $ + * $HeadURL$ * %% * Copyright (C) 2013 CodeLutin, Tony Chemit * %% @@ -26,6 +26,8 @@ import org.nuiton.eugene.java.JavaGeneratorUtil; import org.nuiton.eugene.models.object.ObjectModel; +import org.nuiton.eugene.models.object.ObjectModelAttribute; +import org.nuiton.eugene.models.object.ObjectModelClass; import org.nuiton.eugene.models.object.ObjectModelClassifier; /** @@ -36,6 +38,10 @@ */ public class JpaTemplatesGeneratorUtil extends JavaGeneratorUtil { + public static String getDaoConcreteName(ObjectModelClass input) { + return input.getName() + "JpaDao"; + } + /** * Obtain the value of the {@link JpaTemplatesTagValues#TAG_ENTITY_SUPER_CLASS} * tag value on the given model or classifier. @@ -66,7 +72,34 @@ * @since 2.3 */ public static String getDaoSuperClassTagValue(ObjectModel model, ObjectModelClassifier classifier) { - String value = findTagValue(JpaTemplatesTagValues.TAG_ENTITY_SUPER_CLASS, classifier, model); + String value = findTagValue(JpaTemplatesTagValues.TAG_DAO_SUPER_CLASS, classifier, model); return value; } + + /** + * Obtain the value of the {@link JpaTemplatesTagValues#TAG_PERSISTENCE_CONTEXT_SUPER_CLASS} + * tag value on the given model. + * + * @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_SUPER_CLASS + * @since 2.3 + */ + public static String getPersistenceContextSuperClassTagValue(ObjectModel model) { + String value = findTagValue(JpaTemplatesTagValues.TAG_PERSISTENCE_CONTEXT_SUPER_CLASS, null, model); + return value; + } + + /** + * Check if the given attribute has the + * {@link JpaTemplatesStereoTypes#STEREOTYPE_UNIQUE} stereotype. + * + * @param attribute attribute to test + * @return {@code true} if stereotype was found, {@code false otherwise} + * @see JpaTemplatesStereoTypes#STEREOTYPE_UNIQUE + * @since 2.5 + */ + public static boolean hasUniqueStereotype(ObjectModelAttribute attribute) { + return attribute.hasStereotype(JpaTemplatesStereoTypes.STEREOTYPE_UNIQUE); + } } Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesGeneratorUtil.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesModelPropertiesProvider.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesModelPropertiesProvider.java 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesModelPropertiesProvider.java 2013-05-24 22:14:35 UTC (rev 626) @@ -4,7 +4,7 @@ * #%L * EUGene :: JPA templates * $Id$ - * $HeadURL: http://svn.nuiton.org/svn/eugene/trunk/eugene-jpa-templates/src/main/java/or... $ + * $HeadURL$ * %% * Copyright (C) 2013 CodeLutin, Tony Chemit * %% Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesModelPropertiesProvider.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL 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-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java 2013-05-24 22:14:35 UTC (rev 626) @@ -4,7 +4,7 @@ * #%L * EUGene :: JPA templates * $Id$ - * $HeadURL: http://svn.nuiton.org/svn/eugene/trunk/eugene-jpa-templates/src/main/java/or... $ + * $HeadURL$ * %% * Copyright (C) 2013 CodeLutin, Tony Chemit * %% @@ -25,6 +25,8 @@ */ import org.nuiton.eugene.EugeneStereoTypes; +import org.nuiton.eugene.ModelPropertiesUtil; +import org.nuiton.eugene.models.object.ObjectModelAttribute; /** * Defines all stereotypes managed by JPA templates. @@ -34,4 +36,12 @@ */ public interface JpaTemplatesStereoTypes extends EugeneStereoTypes { + /** + * Stéréotype pour les collections avec unicité. + * + * @see JpaTemplatesGeneratorUtil#hasUniqueStereotype(ObjectModelAttribute) + */ + @ModelPropertiesUtil.StereotypeDefinition(target = ObjectModelAttribute.class, + documentation = "To specify that an attribute is unique (JPA mapping)") + String STEREOTYPE_UNIQUE = "unique"; } Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesStereoTypes.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL 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-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java 2013-05-24 22:14:35 UTC (rev 626) @@ -4,7 +4,7 @@ * #%L * EUGene :: JPA templates * $Id$ - * $HeadURL: http://svn.nuiton.org/svn/eugene/trunk/eugene-jpa-templates/src/main/java/or... $ + * $HeadURL$ * %% * Copyright (C) 2013 CodeLutin, Tony Chemit * %% @@ -62,4 +62,16 @@ "for a class or any class of a model") String TAG_DAO_SUPER_CLASS = "daoSuperClass"; + + /** + * Tag value to use a super class for generated bean. + * + * @see JpaTemplatesGeneratorUtil#getDaoSuperClassTagValue(ObjectModel, ObjectModelClassifier) + * @since 0.1 + */ + @ModelPropertiesUtil.TagValueDefinition( + target = {ObjectModel.class}, + documentation = "To specify a super-class to used on generated persistence context") + String TAG_PERSISTENCE_CONTEXT_SUPER_CLASS = "daoSuperClass"; + } Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/JpaTemplatesTagValues.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Modified: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/package-info.java =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/package-info.java 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/package-info.java 2013-05-24 22:14:35 UTC (rev 626) @@ -8,3 +8,27 @@ */ package org.nuiton.jpa.templates; +/* + * #%L + * nuiton-jpa-templates + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 20013 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% + */ + Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/java/org/nuiton/jpa/templates/package-info.java ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL Added: nuiton-jpa/nuiton-jpa-templates/src/main/resources/META-INF/services/org.nuiton.eugene.ModelPropertiesUtil$ModelPropertiesProvider =================================================================== --- nuiton-jpa/nuiton-jpa-templates/src/main/resources/META-INF/services/org.nuiton.eugene.ModelPropertiesUtil$ModelPropertiesProvider (rev 0) +++ nuiton-jpa/nuiton-jpa-templates/src/main/resources/META-INF/services/org.nuiton.eugene.ModelPropertiesUtil$ModelPropertiesProvider 2013-05-24 22:14:35 UTC (rev 626) @@ -0,0 +1 @@ +org.nuiton.jpa.templates.JpaTemplatesModelPropertiesProvider \ No newline at end of file Property changes on: nuiton-jpa/nuiton-jpa-templates/src/main/resources/META-INF/services/org.nuiton.eugene.ModelPropertiesUtil$ModelPropertiesProvider ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL Added: svn:eol-style + native Modified: nuiton-jpa/pom.xml =================================================================== --- nuiton-jpa/pom.xml 2013-05-24 17:35:29 UTC (rev 625) +++ nuiton-jpa/pom.xml 2013-05-24 22:14:35 UTC (rev 626) @@ -32,7 +32,7 @@ <projectId>nuiton-jpa</projectId> <!-- libs version --> - <eugeneVersion>2.6.2</eugeneVersion> + <eugeneVersion>2.6.3-SNAPSHOT</eugeneVersion> <nuitonUtilsVersion>2.6.12</nuitonUtilsVersion> <processorPluginVersion>1.3</processorPluginVersion> <h2Version>1.3.170</h2Version> Property changes on: nuiton-jpa/pom.xml ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Author Date Id Revision HeadURL
participants (1)
-
tchemit@users.nuiton.org