You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by to...@apache.org on 2005/12/13 21:29:21 UTC
cvs commit: db-ojb build.xml .classpath
tomdz 2005/12/13 12:29:21
Modified: lib Tag: OJB_1_0_RELEASE DdlUtils-1.0-dev.jar
src/java/org/apache/ojb/broker/platforms Tag:
OJB_1_0_RELEASE PlatformDerbyImpl.java
PlatformDb2Impl.java
profile Tag: OJB_1_0_RELEASE derby.profile
. Tag: OJB_1_0_RELEASE build.xml .classpath
Added: src/java/org/apache/ojb/broker/ant Tag: OJB_1_0_RELEASE
Command.java RepositoryDataTask.java
WriteDataSqlToFileCommand.java
WriteDtdToFileCommand.java
WriteDataToDatabaseCommand.java
DataTaskException.java DdlUtilsDataHandling.java
PreparedModel.java DataSet.java
src/schema Tag: OJB_1_0_RELEASE ojbtest-data-new.xml
Log:
Added task that allows to insert data defined in terms of the repository via DdlUtils
Updated Derby platform
Revision Changes Path
No revision
No revision
1.1.2.1 +97 -0 db-ojb/src/java/org/apache/ojb/broker/ant/Attic/Command.java
1.1.2.1 +384 -0 db-ojb/src/java/org/apache/ojb/broker/ant/Attic/RepositoryDataTask.java
1.1.2.1 +167 -0 db-ojb/src/java/org/apache/ojb/broker/ant/Attic/WriteDataSqlToFileCommand.java
1.1.2.1 +88 -0 db-ojb/src/java/org/apache/ojb/broker/ant/Attic/WriteDtdToFileCommand.java
1.1.2.1 +184 -0 db-ojb/src/java/org/apache/ojb/broker/ant/Attic/WriteDataToDatabaseCommand.java
1.1.2.1 +41 -0 db-ojb/src/java/org/apache/ojb/broker/ant/Attic/DataTaskException.java
1.1.2.1 +279 -0 db-ojb/src/java/org/apache/ojb/broker/ant/Attic/DdlUtilsDataHandling.java
1.1.2.1 +359 -0 db-ojb/src/java/org/apache/ojb/broker/ant/Attic/PreparedModel.java
1.1.2.1 +91 -0 db-ojb/src/java/org/apache/ojb/broker/ant/Attic/DataSet.java
No revision
No revision
1.1.2.2 +264 -265 db-ojb/lib/DdlUtils-1.0-dev.jar
<<Binary file>>
No revision
No revision
1.4.2.1 +16 -14 db-ojb/src/schema/ojbtest-data-new.xml
Index: ojbtest-data-new.xml
===================================================================
RCS file: /home/cvs/db-ojb/src/schema/ojbtest-data-new.xml,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- ojbtest-data-new.xml 14 Nov 2005 00:36:11 -0000 1.4
+++ ojbtest-data-new.xml 13 Dec 2005 20:29:20 -0000 1.4.2.1
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
<!--
#/* Copyright 2002-2004 The Apache Software Foundation
# *
@@ -16,6 +16,7 @@
# */
-->
<dataset name="all">
+
<ProductGroup groupId="1" groupName="Beverages" description="Alles leckere zum S�ffeln"/>
<ProductGroup groupId="2" groupName="Spices" description="Gew�rze, Dressings etc."/>
<ProductGroup groupId="3" groupName="Meat" description=""/>
@@ -24,6 +25,7 @@
<ProductGroup groupId="6" groupName="bread" description=""/>
<ProductGroup groupId="7" groupName="Fruits" description="Fr�chte etc."/>
<ProductGroup groupId="8" groupName="Dairy Products" description="Kat 8"/>
+ <ProductGroup groupId="4711" groupName="Random Articles" description="Used for MetadataMultithreadedTest"/>
<Article articleId="1" articleName="Chai" supplierId="1" productGroupId="1" unit="10 boxes x 20 bags" price="18.53" stock="39" orderedUnits="0" minimumStock="10" isSelloutArticle="0"/>
<Article articleId="2" articleName="Chang" supplierId="1" productGroupId="1" unit="24 - 12 oz bottles" price="19.89" stock="17" orderedUnits="40" minimumStock="25" isSelloutArticle="0"/>
@@ -102,6 +104,9 @@
<Article articleId="75" articleName="Rh�nbr�u Klosterbier" supplierId="12" productGroupId="1" unit="24 - 0.5 l bottles" price="7.75" stock="125" orderedUnits="0" minimumStock="25" isSelloutArticle="0"/>
<Article articleId="76" articleName="Lakkalik��ri" supplierId="23" productGroupId="1" unit="500 ml" price="18.0" stock="57" orderedUnits="0" minimumStock="20" isSelloutArticle="0"/>
<Article articleId="77" articleName="Original Frankfurter gr�ne So�e" supplierId="12" productGroupId="2" unit="12 boxes" price="13.0" stock="32" orderedUnits="0" minimumStock="15" isSelloutArticle="0"/>
+ <Article articleId="4711" articleName="Proxied Article 1" supplierId="12" productGroupId="4711" unit="1 Java class" price="1.3" stock="5" orderedUnits="0" minimumStock="1" isSelloutArticle="0"/>
+ <Article articleId="4712" articleName="Proxied Article 2" supplierId="12" productGroupId="4711" unit="1 Java class" price="1.5" stock="2" orderedUnits="0" minimumStock="0" isSelloutArticle="0"/>
+ <Article articleId="4713" articleName="Proxied Article 3" supplierId="12" productGroupId="4711" unit="1 Java class" price="1.9" stock="7" orderedUnits="0" minimumStock="5" isSelloutArticle="0"/>
<BookArticle articleId="100" articleName="Hamlet" supplierId="12" productGroupId="5" unit="12 boxes" price="34.0" stock="32" orderedUnits="0" minimumStock="15" isSelloutArticle="0" isbn="1234567890" author="W. Shakespeare"/>
<BookArticle articleId="101" articleName="Faust" supplierId="12" productGroupId="5" unit="12 boxes" price="56.0" stock="32" orderedUnits="0" minimumStock="15" isSelloutArticle="0" isbn="1234567890" author="J.W. v. Goethe"/>
@@ -134,8 +139,8 @@
<Role member_id="1" project_id="1" roleName="founder"/>
<Role member_id="1" project_id="2" roleName="friend"/>
- <Role member_id="2" project_id="2" roleName="lead"/>
<Role member_id="2" project_id="1" roleName="developer"/>
+ <Role member_id="2" project_id="2" roleName="lead"/>
<Role member_id="2" project_id="3" roleName="developer"/>
<Role member_id="3" project_id="2" roleName="tester"/>
<Role member_id="3" project_id="4" roleName="user"/>
@@ -147,10 +152,10 @@
<Role member_id="7" project_id="5" roleName="founder"/>
<Role member_id="7" project_id="6" roleName="tester"/>
- <Task task_id="1" member_id="2" project_id="1" taskName="Initial Layout"/>
- <Task task_id="2" member_id="2" project_id="1" taskName="Initial Spec"/>
- <Task task_id="3" member_id="2" project_id="2" taskName="Project Cleanup"/>
- <Task task_id="4" member_id="2" project_id="3" taskName="Testing Scripts"/>
+ <Task task_id="1" person_id="2" project_id="1" taskName="Initial Layout"/>
+ <Task task_id="2" person_id="2" project_id="1" taskName="Initial Spec"/>
+ <Task task_id="3" person_id="2" project_id="2" taskName="Project Cleanup"/>
+ <Task task_id="4" person_id="2" project_id="3" taskName="Testing Scripts"/>
<FieldConversionTest_2_ConversionReferrer pk1="1" ref1="50" testId="10"/>
<FieldConversionTest_2_ConversionReferrer pk1="2" ref1="51" testId="11"/>
@@ -174,14 +179,14 @@
<News id="2" headline="Ferrai for sale (CARS - BUYERS)"/>
<News id="3" headline="Brazil World Cup Champion ! (SPORTS)"/>
- <Paper id="10" headline="NONE" issuedate="today" author="NONE"/>
- <Paper id="11" headline="SALES" issuedate="yesterday" author="SALES MAN"/>
+ <Paper id="10" date="today" author="NONE"/>
+ <Paper id="11" date="yesterday" author="SALES MAN"/>
<Topic id="10" name="Buyers" importance="important"/>
<Topic id="11" name="Sellers" importance="unimportant"/>
- <TopicExt id="30" name="Buyers_Ext" importance="important" Description="The buyer"/>
- <TopicExt id="31" name="Sellers_Ext" importance="unimportant" Description="The seller"/>
+ <TopicExt id="30" name="Buyers_Ext" importance="important" description="The buyer"/>
+ <TopicExt id="31" name="Sellers_Ext" importance="unimportant" description="The seller"/>
<Category id="1" name="Cars" description="The cars category"/>
<Category id="2" name="Sports"/>
@@ -196,7 +201,4 @@
<CONTENT_QUALIFIER CONTENT_ID="10" QUALIFIER_ID="20"/>
<CONTENT_QUALIFIER CONTENT_ID="11" QUALIFIER_ID="11"/>
<CONTENT_QUALIFIER CONTENT_ID="11" QUALIFIER_ID="31"/>
-
- <InitializableObject Id="1"/>
- <InitializableObject Id="2"/>
-</dataset>
\ No newline at end of file
+</dataset>
No revision
No revision
1.1.2.2 +8 -125 db-ojb/src/java/org/apache/ojb/broker/platforms/Attic/PlatformDerbyImpl.java
Index: PlatformDerbyImpl.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/platforms/Attic/PlatformDerbyImpl.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- PlatformDerbyImpl.java 11 Dec 2005 20:03:08 -0000 1.1.2.1
+++ PlatformDerbyImpl.java 13 Dec 2005 20:29:20 -0000 1.1.2.2
@@ -15,140 +15,23 @@
* limitations under the License.
*/
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.sql.Types;
-import java.util.Properties;
-
-import org.apache.ojb.broker.util.sequence.SequenceManagerHelper;
/**
- * This class extends <code>PlatformDefaultImpl</code> and defines specific
- * behavior for the Derby platform. Based upon
- * {@link org.apache.ojb.broker.platforms.PlatformDb2Impl}.
+ * This class defines specific behavior for the Derby platform.
*/
public class PlatformDerbyImpl extends PlatformDefaultImpl
{
/**
- * Patch provided by Avril Kotzen (hi001@webmail.co.za)
- * DB2 handles TINYINT (for mapping a byte).
+ * {@inheritDoc}
*/
- public void setObjectForStatement(PreparedStatement ps, int index,
- Object value, int sqlType) throws SQLException
- {
- if (sqlType == Types.TINYINT)
- {
- ps.setByte(index, ((Byte) value).byteValue());
- }
- else
- {
- super.setObjectForStatement(ps, index, value, sqlType);
- }
- }
-
- public String createSequenceQuery(String sequenceName)
- {
- return "create sequence " + sequenceName;
- }
-
- public String createSequenceQuery(String sequenceName, Properties prop)
- {
- /*
- Read syntax diagramSkip visual syntax diagram
- .-AS INTEGER----.
- >>-CREATE SEQUENCE--sequence-name--*--+---------------+--*------>
- '-AS--data-type-'
-
- >--+------------------------------+--*-------------------------->
- '-START WITH--numeric-constant-'
-
- .-INCREMENT BY 1-----------------.
- >--+--------------------------------+--*------------------------>
- '-INCREMENT BY--numeric-constant-'
-
- .-NO MINVALUE----------------.
- >--+----------------------------+--*---------------------------->
- '-MINVALUE--numeric-constant-'
-
- .-NO MAXVALUE----------------. .-NO CYCLE-.
- >--+----------------------------+--*--+----------+--*----------->
- '-MAXVALUE--numeric-constant-' '-CYCLE----'
-
- .-CACHE 20----------------. .-NO ORDER-.
- >--+-------------------------+--*--+----------+--*-------------><
- +-CACHE--integer-constant-+ '-ORDER----'
- '-NO CACHE----------------'
- */
- StringBuffer query = new StringBuffer(createSequenceQuery(sequenceName));
- if(prop != null)
- {
- Boolean b;
- Long value;
- String str;
-
- str = SequenceManagerHelper.getSeqAsValue(prop);
- if(str != null)
- {
- query.append(" AS ").append(str);
- }
-
- value = SequenceManagerHelper.getSeqStart(prop);
- if(value != null)
- {
- query.append(" START WITH ").append(value.longValue());
- }
-
- value = SequenceManagerHelper.getSeqIncrementBy(prop);
- if(value != null)
- {
- query.append(" INCREMENT BY ").append(value.longValue());
- }
-
- value = SequenceManagerHelper.getSeqMinValue(prop);
- if(value != null)
- {
- query.append(" MINVALUE ").append(value.longValue());
- }
-
- value = SequenceManagerHelper.getSeqMaxValue(prop);
- if(value != null)
- {
- query.append(" MAXVALUE ").append(value.longValue());
- }
-
- b = SequenceManagerHelper.getSeqCycleValue(prop);
- if(b != null)
- {
- if(b.booleanValue()) query.append(" CYCLE");
- else query.append(" NO CYCLE");
- }
-
- value = SequenceManagerHelper.getSeqCacheValue(prop);
- if(value != null)
- {
- query.append(" CACHE ").append(value.longValue());
- }
-
- b = SequenceManagerHelper.getSeqOrderValue(prop);
- if(b != null)
- {
- if(b.booleanValue()) query.append(" ORDER");
- else query.append(" NO ORDER");
- }
- }
- return query.toString();
- }
-
- public String nextSequenceQuery(String sequenceName)
+ public byte getJoinSyntaxType()
{
- return "values nextval for "+ sequenceName;
- }
-
- public String dropSequenceQuery(String sequenceName)
- {
- return "drop sequence " + sequenceName;
+ return SQL92_NOPAREN_JOIN_SYNTAX;
}
+ /**
+ * {@inheritDoc}
+ */
public String getLastInsertIdentityQuery(String tableName)
{
// matthias.roth@impart.ch
@@ -158,6 +41,6 @@
// or use useAutoCommit="1" or use a connection with autoCommit set false
// by default (e.g. in managed environments)
// transaction demarcation is mandatory
- return "select IDENTITY_VAL_LOCAL() from sysibm.sysdummy1";
+ return "values IDENTITY_VAL_LOCAL()";
}
}
1.10.2.3 +2 -2 db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformDb2Impl.java
Index: PlatformDb2Impl.java
===================================================================
RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/platforms/PlatformDb2Impl.java,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -u -r1.10.2.2 -r1.10.2.3
--- PlatformDb2Impl.java 22 Aug 2005 15:27:28 -0000 1.10.2.2
+++ PlatformDb2Impl.java 13 Dec 2005 20:29:20 -0000 1.10.2.3
@@ -256,6 +256,6 @@
// or use useAutoCommit="1" or use a connection with autoCommit set false
// by default (e.g. in managed environments)
// transaction demarcation is mandatory
- return "select IDENTITY_VAL_LOCAL() from sysibm.sysdummy1";
+ return "values IDENTITY_VAL_LOCAL()";
}
}
No revision
No revision
1.1.2.2 +12 -6 db-ojb/profile/Attic/derby.profile
Index: derby.profile
===================================================================
RCS file: /home/cvs/db-ojb/profile/Attic/derby.profile,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- derby.profile 11 Dec 2005 20:03:08 -0000 1.1.2.1
+++ derby.profile 13 Dec 2005 20:29:20 -0000 1.1.2.2
@@ -75,10 +75,11 @@
# -------------------------------------------------------------------
dbmsName = Derby
-jdbcLevel = 1.0
+jdbcLevel = 3.0
urlProtocol = jdbc
-urlSubprotocol = derby:directory
-urlDbalias = OJB
+urlSubprotocol = derby
+#urlDbalias = OJB
+urlDbalias = //localhost/OJB
#
@@ -87,11 +88,16 @@
torque.database.createUrl = ${urlProtocol}:${urlSubprotocol}:${urlDbalias}
torque.database.buildUrl = ${urlProtocol}:${urlSubprotocol}:${urlDbalias}
torque.database.url = ${urlProtocol}:${urlSubprotocol}:${urlDbalias}
-torque.database.driver = org.apache.derby.jdbc.EmbeddedDriver
-torque.database.user = app
-torque.database.password =
torque.database.host = 127.0.0.1
+#torque.database.driver = org.apache.derby.jdbc.EmbeddedDriver
+#torque.database.user = app
+#torque.database.password =
+
+torque.database.driver = org.apache.derby.jdbc.ClientDriver
+torque.database.user = ojb
+torque.database.password = ojb
+
# Tells JDBC task that javaName attribute for the tables and columns
# should be made same as SQL name.
No revision
No revision
1.144.2.29 +15 -3 db-ojb/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/db-ojb/build.xml,v
retrieving revision 1.144.2.28
retrieving revision 1.144.2.29
diff -u -r1.144.2.28 -r1.144.2.29
--- build.xml 11 Dec 2005 20:03:08 -0000 1.144.2.28
+++ build.xml 13 Dec 2005 20:29:20 -0000 1.144.2.29
@@ -401,6 +401,9 @@
<taskdef name="ddl2Database"
classname="org.apache.ddlutils.task.DdlToDatabaseTask"
classpathref="runtime-classpath"/>
+ <taskdef name="ojbData"
+ classname="org.apache.ojb.broker.ant.RepositoryDataTask"
+ classpathref="runtime-classpath"/>
<copy todir="${build.test}">
<fileset dir="${src.dir}/schema" includes="*.xml,*.dtd"/>
@@ -408,7 +411,6 @@
<filter token="DATABASE_DEFAULT" value="${project}" />
</filterset>
</copy>
-
<ddl2Database usedelimitedsqlidentifiers="false">
<database driverclassname="${torque.database.driver}"
url="${torque.database.createUrl}"
@@ -416,10 +418,20 @@
password="${torque.database.password}"/>
<fileset dir="${build.test}"
includes="*schema.xml"/>
-
+
<createdatabase failonerror="false"/>
<writeschematodatabase alterdatabase="false"/>
</ddl2Database>
+ <ojbData usedelimitedsqlidentifiers="false"
+ ojbpropertiesfile="${build.test}/ojb/OJB.properties" >
+ <database driverclassname="${torque.database.driver}"
+ url="${torque.database.createUrl}"
+ username="${torque.database.user}"
+ password="${torque.database.password}"/>
+ <fileset dir="${build.test}"
+ includes="*schema.xml"/>
+ <writedatatodatabase datafile="${build.test}/ojbtest-data-new.xml"/>
+ </ojbData>
</target>
<!-- ================================================================== -->
1.35.2.14 +2 -0 db-ojb/.classpath
Index: .classpath
===================================================================
RCS file: /home/cvs/db-ojb/.classpath,v
retrieving revision 1.35.2.13
retrieving revision 1.35.2.14
diff -u -r1.35.2.13 -r1.35.2.14
--- .classpath 9 Nov 2005 16:10:10 -0000 1.35.2.13
+++ .classpath 13 Dec 2005 20:29:20 -0000 1.35.2.14
@@ -38,5 +38,7 @@
<classpathentry kind="lib" path="lib/ant-1.6.5.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.1.jar"/>
<classpathentry kind="lib" path="lib/xml-apis-1.3.02.jar"/>
+ <classpathentry kind="lib" path="lib/DdlUtils-1.0-dev.jar"/>
+ <classpathentry kind="lib" path="lib/commons-digester-1.7.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org