From: Vance K. <va...@us...> - 2007-02-13 02:41:44
|
User: vancek Date: 07/02/12 18:41:40 Modified: andromda-ejb3/src/main/resources/templates/ejb3/config/jboss login-config.xml.vsl andromda-ejb3/src/main/resources/META-INF/andromda namespace.xml cartridge.xml andromda-ejb3/conf/test andromda.xml andromda-ejb3/conf/howto andromda.xml andromda-ejb3/src/main/resources/templates/ejb3/config persistence.xml.vsl andromda-ejb3/src/test/expected cartridge-output.zip andromda-ejb3/src/main/resources/templates/ejb3/microcontainer embedded-jboss-beans.xml.vsl Log: add support for jdbc properties that now exists in andromda.xml config Revision Changes Path 1.2 +5 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/jboss/login-config.xml.vsl Index: login-config.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/jboss/login-config.xml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- login-config.xml.vsl 14 Mar 2006 06:14:11 -0000 1.1 +++ login-config.xml.vsl 13 Feb 2007 02:41:40 -0000 1.2 @@ -10,7 +10,11 @@ flag="required"> <module-option name="debug">true</module-option> <module-option name="unauthenticatedIdentity">guest</module-option> - <module-option name="dsJndiName">${entityManagerJTADataSource}</module-option> + <module-option name="dsJndiName">${dataSource}</module-option> + <module-option name="userName">${username}</module-option> +#if ($stringUtils.isNotBlank(${password})) + <module-option name="password">${password}</module-option> +#end <module-option name="principalsQuery"> SELECT PASSWORD 'Password' FROM principal WHERE BINARY PRINCIPAL_ID =? </module-option> 1.36 +32 -1 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/namespace.xml Index: namespace.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/namespace.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -r1.35 -r1.36 --- namespace.xml 11 Feb 2007 14:06:34 -0000 1.35 +++ namespace.xml 13 Feb 2007 02:41:40 -0000 1.36 @@ -237,6 +237,37 @@ in the deployed ear package. </documentation> </property> + <property name="driver" required="false"> + <documentation> + JDBC Driver to make a database connection. + </documentation> + </property> + <property name="username" required="false"> + <documentation> + The database user login name. + </documentation> + </property> + <property name="password" required="false"> + <documentation> + The database user password. + </documentation> + </property> + <property name="connectionUrl" required="false"> + <documentation> + URL for the JDBC Driver to make the connection to the database. + </documentation> + </property> + <property name="dataSource" required="false"> + <documentation> + Full JNDI name of data source to use. (would be used instead + of the connection properties, driver, username, password, etc). + </documentation> + </property> + <property name="dataSourceName" required="false"> + <documentation> + The JNDI name of data source to use without prefix like java:/. + </documentation> + </property> </propertyGroup> <propertyGroup name="Cache"> <property name="hibernateCacheProvider" required="false"> 1.36 +6 -1 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -r1.35 -r1.36 --- cartridge.xml 12 Feb 2007 02:07:46 -0000 1.35 +++ cartridge.xml 13 Feb 2007 02:41:40 -0000 1.36 @@ -16,8 +16,13 @@ <!-- cartridge-templateObject merge-point--> + <property reference="driver"/> + <property reference="username"/> + <property reference="password"/> + <property reference="connectionUrl"/> + <property reference="dataSource"/> + <property reference="dataSourceName"/> <property reference="entityManagerName"/> - <property reference="entityManagerJTADataSource"/> <property reference="hibernateHbm2DDLAuto"/> <property reference="hibernateDialect"/> <property reference="hibernateShowSql"/> 1.3 +6 -1 cartridges/andromda-ejb3/conf/test/andromda.xml Index: andromda.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/conf/test/andromda.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- andromda.xml 7 Feb 2007 04:28:44 -0000 1.2 +++ andromda.xml 13 Feb 2007 02:41:40 -0000 1.3 @@ -43,6 +43,12 @@ <namespace name="ejb3"> <properties> <property name="overwrite">true</property> + <property name="dataSourceName">DefaultDS</property> + <property name="dataSource">java:/DefaultDS</property> + <property name="username">auser</property> + <property name="password">apassword</property> + <property name="driver">a.driver.Class</property> + <property name="connectionUrl">a:connection:url</property> <property name="mergeMappingsUri">file:${test.src.dir}/mappings/MergeMappings.xml</property> <property name="value-objects">${test.output.dir}</property> <property name="entity-beans">${test.output.dir}</property> @@ -67,7 +73,6 @@ <property name="persistenceContainerName">jboss</property> <property name="persistenceContextUnitName">ejb3test</property> <property name="entityManagerName">ejb3test</property> - <property name="entityManagerJTADataSource">java:/DefaultDS</property> <property name="hibernateDialect">net.sf.hibernate.dialect.HSQLDialect</property> <property name="hibernateHbm2DDLAuto">update</property> <property name="enableTemplating">true</property> 1.3 +6 -1 cartridges/andromda-ejb3/conf/howto/andromda.xml Index: andromda.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/conf/howto/andromda.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- andromda.xml 4 Feb 2007 04:18:19 -0000 1.2 +++ andromda.xml 13 Feb 2007 02:41:40 -0000 1.3 @@ -39,6 +39,12 @@ </namespace> <namespace name="ejb3"> <properties> + <property name="dataSourceName">jdbc/howtomodel</property> + <property name="dataSource">java:/jdbc/howtomodel</property> + <property name="username">auser</property> + <property name="password">apassword</property> + <property name="driver">com.mysql.jdbc.Driver</property> + <property name="connectionUrl">jdbc:mysql://localhost:3306/howtomodel</property> <property name="entity-beans">${howto.output.dir}</property> <property name="entity-impls">${howto.output.dir}</property> <property name="entity-config">${howto.output.dir}</property> @@ -61,7 +67,6 @@ <property name="persistenceContainerName">jboss</property> <property name="persistenceContextUnitName">howtomodel</property> <property name="entityManagerName">howtomodel</property> - <property name="entityManagerJTADataSource">java:/jdbc/howtomodel</property> <property name="hibernateDialect">net.sf.hibernate.dialect.HSQLDialect</property> <property name="hibernateHbm2DDLAuto">update</property> <property name="enableTemplating">true</property> 1.4 +3 -3 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/persistence.xml.vsl Index: persistence.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/persistence.xml.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- persistence.xml.vsl 14 Jun 2006 08:08:47 -0000 1.3 +++ persistence.xml.vsl 13 Feb 2007 02:41:40 -0000 1.4 @@ -14,8 +14,8 @@ version="1.0"> --> <persistence-unit name="${entityManagerName}"> -#if ($stringUtils.isNotBlank($entityManagerJTADataSource)) - <jta-data-source>${entityManagerJTADataSource}</jta-data-source> +#if ($stringUtils.isNotBlank(${dataSource})) + <jta-data-source>${dataSource}</jta-data-source> #end #if ($stringUtils.isNotBlank($jarFiles)) #**##set ($jars = $stringUtils.split($jarFiles,',')) @@ -83,7 +83,7 @@ </persistence-unit> #foreach ($persistenceContext in $persistenceContexts) <persistence-unit name="${persistenceContext.unitName}"> -#**##if ($stringUtils.isNotBlank($entityManagerJTADataSource)) +#**##if ($stringUtils.isNotBlank(${persistenceContext.datasource})) <jta-data-source>${persistenceContext.datasource}</jta-data-source> #**##end <properties> 1.4 +451 -458 cartridges/andromda-ejb3/src/test/expected/cartridge-output.zip <<Binary file>> 1.2 +9 -7 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/microcontainer/embedded-jboss-beans.xml.vsl Index: embedded-jboss-beans.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/microcontainer/embedded-jboss-beans.xml.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- embedded-jboss-beans.xml.vsl 4 Feb 2007 02:45:05 -0000 1.1 +++ embedded-jboss-beans.xml.vsl 13 Feb 2007 02:41:40 -0000 1.2 @@ -92,13 +92,15 @@ </constructor> </bean> -#if ($stringUtils.isNotBlank(${entityManagerName})) +#if ($stringUtils.isNotBlank(${dataSource})) <bean name="${entityManagerName}DatasourceBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource"> - <property name="driverClass">com.mysql.jdbc.Driver</property> - <property name="connectionURL">jdbc:mysql://localhost:3306/${entityManagerName}</property> - <!-- <property name="connectionURL">jdbc:hsqldb:./hypersonic/localDB</property> --> - <property name="userName">sa</property> - <property name="jndiName">java:/jdbc/${entityManagerName}</property> + <property name="driverClass">${driver}</property> + <property name="connectionURL">${connectionUrl}</property> + <property name="userName">${username}</property> +#**##if ($stringUtils.isNotBlank(${password})) + <property name="password">${password}</property> +#**##end + <property name="jndiName">${dataSource}</property> <property name="minSize">0</property> <property name="maxSize">10</property> <property name="blockingTimeout">1000</property> @@ -108,7 +110,7 @@ <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property> </bean> - <bean name="jdbc/${entityManagerName}" class="java.lang.Object"> + <bean name="${dataSourceName}" class="java.lang.Object"> <constructor factoryMethod="getDatasource"> <factory bean="${entityManagerName}DatasourceBootstrap"/> </constructor> |