From: Alexey L. <lou...@us...> - 2002-09-24 16:07:39
|
User: loubyansky Date: 02/09/24 09:07:36 Modified: src/etc/conf/default Tag: Branch_3_2 standardjbosscmp-jdbc.xml Log: porting standardjbosscmp-jdbc.xml (support for unknown-pk and entity-commands) from HEAD to Branch_3_2 Revision Changes Path No revision No revision 1.39.2.5 +40 -0 jboss/src/etc/conf/default/standardjbosscmp-jdbc.xml Index: standardjbosscmp-jdbc.xml =================================================================== RCS file: /cvsroot/jboss/jboss/src/etc/conf/default/standardjbosscmp-jdbc.xml,v retrieving revision 1.39.2.4 retrieving revision 1.39.2.5 diff -u -r1.39.2.4 -r1.39.2.5 --- standardjbosscmp-jdbc.xml 21 Sep 2002 23:38:08 -0000 1.39.2.4 +++ standardjbosscmp-jdbc.xml 24 Sep 2002 16:07:35 -0000 1.39.2.5 @@ -29,6 +29,16 @@ <eager-load-group>*</eager-load-group> </read-ahead> <list-cache-max>1000</list-cache-max> + + <unknown-pk> + <key-generator-factory>UUIDKeyGeneratorFactory</key-generator-factory> + <unknown-pk-class>java.lang.String</unknown-pk-class> + <jdbc-type>VARCHAR</jdbc-type> + <sql-type>VARCHAR(32)</sql-type> + </unknown-pk> + + <entity-command name="default"/> + </defaults> <type-mapping> @@ -1322,6 +1332,7 @@ <row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 FOR UPDATE</row-locking-template> <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template> <fk-constraint-template>ALTER TABLE ?1 ADD INDEX ind_?3 (?3), ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template> + <auto-increment-template>?1 auto_increment</auto-increment-template> <alias-header-prefix>t</alias-header-prefix> <alias-header-suffix>_</alias-header-suffix> <alias-max-length>32</alias-max-length> @@ -1436,6 +1447,7 @@ <jdbc-type>TIME</jdbc-type> <sql-type>BIGINT</sql-type> </mapping> + </type-mapping> <type-mapping> @@ -2045,4 +2057,32 @@ </type-mapping> </type-mappings> + + <entity-commands> + <!-- default command; doesn't support unknown-pk --> + <entity-command name="default" + class="org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand"/> + + <!-- fetches next key value with the specified sql statement --> + <entity-command name="pk-sql" + class="org.jboss.ejb.plugins.cmp.jdbc.JDBCPkSqlCreateCommand"> + <attribute name="pk-sql">SELECT CURRENT_TIMESTAMP</attribute> + </entity-command> + + <!-- this command requires auto-increment element for unknown-pk --> + <entity-command name="mysql-get-generated-keys" + class="org.jboss.ejb.plugins.cmp.jdbc.mysql.JDBCMySQLCreateCommand"/> + + <!-- uses key generator to fetch the next key value --> + <entity-command name="key-generator" + class="org.jboss.ejb.plugins.cmp.jdbc.JDBCKeyGeneratorCreateCommand"> + <attribute name="key-generator-factory">UUIDKeyGeneratorFactory</attribute> + </entity-command> + +<!-- JDK1.4 + <entity-command name="get-generated-keys" + class="org.jboss.ejb.plugins.cmp.jdbc.jdbc3.JDBCGetGeneratedKeysCreateCommand"/> +--> + </entity-commands> + </jbosscmp-jdbc> |