RE: one table -> multiple classes problem
Hi again, one thing i forgot to ask in my last mail : storing the ojbects in the database you also need 2 db access, don't you ? you have to store each of the two classes separately ? Thanks again, Andreas > >Hi, >you can do it without problem. > >I have two classes for > one table. > >Classes: Crm_cliente_masinfo, Crm_cliente_general >Ta > ble: CRM_CLIENTE > > (1)First xml descriptor. > > > > > > > > > class="com.indra.crm.vo.Crm_cliente_masinfo" > table="CRM_CLIENTE" > > >name="ln_id_cliente" > column= > "LN_ID_CLIENTE" > jdbc-type="INTEGER" > primarykey="true" > aut > oincrement="true" > sequence-name="sec_cliente" > /> >iptor id="73" > name="ds_url" > column="DS_URL" > jdbc-typ > e="VARCHAR" > /> >name="ts_coment > ario" > column="TS_COMENTARIO" > jdbc-type="VARCHAR" > /> > < > field-descriptor id="79" > name="ln_facturacion" > column="LN > _FACTURACION" > jdbc-type="INTEGER" > /> >"80" > name="mn_nu_empleados" > column="MN_NU_EMPLEADOS" > j > dbc-type="INTEGER" > /> >name="mn > _nu_fact_emp" > column="MN_NU_FACT_EMP" > jdbc-type="INTEGER" > /> >name="sn_movil_emp" > colum > n="SN_MOVIL_EMP" > jdbc-type="INTEGER" > /> >id="83" > name="sn_nu_sedes" > column="SN_NU_SEDES" > jdbc > -type="INTEGER" > /> >name="sn_nu > _sedes_hfc" > column="SN_NU_SEDES_HFC" > jdbc-type="INTEGER" > > /> >name="ln_potencial_total" > > column="LN_POTENCIAL_TOTAL" > jdbc-type="INTEGER" > /> >descriptor id="86" > name="ln_potencial_fijo" > column="LN_PO > TENCIAL_FIJO" > jdbc-type="INTEGER" > /> >"87" > name="ln_potencial_movil" > column="LN_POTENCIAL_MOVIL" > jdbc-type="INTEGER" > /> >name= > "ln_potencial_datos" > column="LN_POTENCIAL_DATOS" > jdbc-type= > "INTEGER" > /> >name="ln_potencial_ > fijo_emp" > column="LN_POTENCIAL_FIJO_EMP" > jdbc-type="INTEGER > " > /> >name="ln_potencial_datos_em > p" > column="LN_POTENCIAL_DATOS_EMP" > jdbc-type="INTEGER" > / > > >name="ln_potencial_movil_emp" > > column="LN_POTENCIAL_MOVIL_EMP" > jdbc-type="INTEGER" > /> > < > field-descriptor id="92" > name="sn_id_usuario_alta" > column= > "SN_ID_USUARIO_ALTA" > jdbc-type="INTEGER" > /> >r id="93" > name="dt_fh_alta" > column="DT_FH_ALTA" > jdbc > -type="TIMESTAMP" > /> >name="sn_ > id_usuario_mod" > column="SN_ID_USUARIO_MOD" > jdbc-type="INTEG > ER" > /> >name="dt_fh_mod" > col > umn="DT_FH_MOD" > jdbc-type="TIMESTAMP" > /> > id="96" > name="sn_id_usuario_baja" > column="SN_ID_USUARIO_ > BAJA" > jdbc-type="INTEGER" > /> > > name="dt_fh_baja" > column="DT_FH_BAJA" > jdbc-type="TIMEST > AMP" > /> > > > > > (2) Second xml descriptor > > > > > > > > lass-descriptor > class="com.indra.crm.vo.Crm_cliente_general" > tab > le="CRM_CLIENTE" > > >name="ln_id_c > liente" > column="LN_ID_CLIENTE" > jdbc-type="INTEGER" > pri > marykey="true" > autoincrement="true" > sequence-name="sec_cliente" > > /> >name="ds_nb_cliente" > co > lumn="DS_NB_CLIENTE" > jdbc-type="VARCHAR" > /> >tor id="68" > name="ss_cif" > column="SS_CIF" > jdbc-type= > "VARCHAR" > /> >name="sn_lv_tipo_cl > iente" > column="SN_LV_TIPO_CLIENTE" > jdbc-type="INTEGER" > / > > >name="sn_lv_estado" > column= > "SN_LV_ESTADO" > jdbc-type="INTEGER" > /> >"71" > name="sn_id_gestor_asignado" > column="SN_ID_GESTOR_ASIG > NADO" > jdbc-type="INTEGER" > /> > > name="sc_gran_cliente" > column="SC_GRAN_CLIENTE" > jdbc-type > ="CHAR" > /> >name="ln_jefe_proye > cto" > column="LN_JEFE_PROYECTO" > jdbc-type="VARCHAR" > /> > > name="ms_id_migracion" > column= > "MS_ID_MIGRACION" > jdbc-type="VARCHAR" > /> >d="77" > name="ms_id_codigo_amena" > column="MS_ID_CODIGO_AME > NA" > jdbc-type="VARCHAR" > /> > > name="ms_id_codigo_auna_tlc" > column="MS_ID_CODIGO_AUNA_TLC" > > jdbc-type="VARCHAR" > /> >name=" > sn_id_usuario_alta" > column="SN_ID_USUARIO_ALTA" > jdbc-type=" > INTEGER" > /> >name="dt_fh_alta" > >column="DT_FH_ALTA" > jdbc-type="TIMESTAMP" > /> >criptor id="94" > name="sn_id_usuario_mod" > column="SN_ID_US > UARIO_MOD" > jdbc-type="INTEGER" > /> >name="dt_fh_mod" > column="DT_FH_MOD" > jdbc-type="TIM > ESTAMP" > /> >name="sn_id_usuario_b > aja" > column="SN_ID_USUARIO_BAJA" > jdbc-type="INTEGER" > /> >name="dt_fh_baja" > column="DT_ > FH_BAJA" > jdbc-type="TIMESTAMP" > /> >name="ln_id_cliente_padre" > col
Re: Problems with xdoclet-ojb-module
Thomas Dudziak wrote: This is usually the case when xdoclet finds no source code.# That's is. Thanks. Try running ant with the -v option to see some more output. There was no output indicating, that the fileset for the java source in my ant target was wrong: [EMAIL PROTECTED] project]$ bin/build.sh -v repository-files Apache Ant version 1.5.3 compiled on April 16 2003 Buildfile: build.xml Detected Java version: 1.4 in: /usr/java/j2sdk1.4.1_03/jre Detected OS: Linux parsing buildfile build.xml with URI = file:/home/cpesch/metamusic/test/project/build.xml Project base dir set to: /home/cpesch/metamusic/test/project [property] Loading /home/cpesch/build.properties [property] Unable to find property file: /home/cpesch/build.properties [property] Loading /home/cpesch/metamusic/test/project/build.properties [property] Loading /home/cpesch/metamusic/test/project/profile/mysql.profile Override ignored for property project Override ignored for property SQLControlTemplate Override ignored for property schemaDirectory Property ${lib.repo} has not been set Override ignored for property outputDirectory Build sequence for target `repository-files' is [repository-files] Complete build sequence is [repository-files, set-archive-name, set-archive-name-date, detect-jdk, check-jdk12proxy-classes, check-jndi-classes, use-jdk12, use-jdk13, use-jdk14, init, prepare, javadoc, checkP6Spy, check-j2ee-classes, preprocess, resources, main, declare, api, reverse-db, main-optimized, spec, doc, check-jdo-classes, useP6Spy, dontUseP6Spy, prepare-repository, prepare-db, junit-no-compile-no-prepare, junit-no-compile, reverse-db2, verify, jar, war, clean, all, useDate, source, docs, tarball, release, snapshot, check-jdori-classes, browse-db, copy-db, junit-quick, initJNETSQLServer, getJSQLDriver, jar-debug, junit, run-test, dump-db] repository-files: dropping /home/cpesch/metamusic/test/project/j2ee.jar from path as it doesn't exist dropping /home/cpesch/metamusic/test/project/jdo.jar from path as it doesn't exist dropping /home/cpesch/metamusic/test/project/jdori.jar from path as it doesn't exist [ojbdoclet] (XDocletMain.start 47 ) Running [ojbdoclet] Generating repository_user.xml. [ojbdoclet] (XDocletMain.start 47 ) Running [ojbdoclet] Generating metamusic_schema.xml. -- Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: not case sensitve search in DB2
hi bad thing to do performance wise, if u have an index on the colmn eg the username and use this construction then the index is not used and you end up with a table scan. I think you can better "manage" it while inserting, eg class User { private String userName; public setUserName(String name) { this.userName = name.toLowerCase(); } ... } and modify the query's with Criteria criteria = new Criteria(); criteria.addEqualTo("userName", name.toLowerCase()); ... Bram -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 5:16 PM To: [EMAIL PROTECTED] Subject: not case sensitve search in DB2 Hi, has some body made an SqlGenerator Class that generates a where claus like this: select x,y,z from a where upper(z) like upper(?) this is helpful if the database like claus is case sensitiv, like in oracle or db2. regards Matthias Roth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with xdoclet-ojb-module
No, it seems I misunderstood you. Here is the relevant part from one of my build files (which doesn't look too different from yours): ... ... Again, as I said, try the -v option as it could be that not the OjbDocletTask class itself is missing but one of the required libraries, and Ant/xdoclet will only tell you which one when you use the -v option (as only then you see the NoClassDefFoundErrors). Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems rc4 tests on db2 7.2.5
Hello, i try to test ojb for my next project. I followed the instructions in the "get startet" section but when I build and test ojb1.0rc4 on my system (win2k, jdk1.4.2, ibm DB2 7.2.5 and the IBM jdbc-driver) I get SQL Errors and some of the tests fail. I think the error in the odmg tests happens because of the failed create of table ojb_dmap_entries. I don't know if the error in testDeleteWithRemovalAwareCollection has the same reason. I'm not an DB2/SQL guru but the statement in /target/src/sql/ojbcore-schema.sql seems to be wrong CREATE TABLE OJB_DMAP_ENTRIES ( ID INTEGER NOT NULL, DMAP_ID INTEGER NOT NULL, KEY_OID VARCHAR(250) FOR BIT DATA VARCHAR(n) FOR BIT DATA, VALUE_OID VARCHAR(250) FOR BIT DATA VARCHAR(n) FOR BIT DATA ); ALTER TABLE OJB_DMAP_ENTRIES ADD PRIMARY KEY (ID); How is the right syntax of the create statement? I read that this sql is generated by tourque so it makes no sense to correct it here? Is there a fix for this problem? Does this error effect the functionality of the odmg interface? Thanks for help Martin Grüneberg Here is the output of the test-run: .\bin\build.bat junit from cmd: build.bat junit [torque-insert-sql] Failed to execute: drop table OJB_DMAP_ENTRIES [torque-insert-sql] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0204N "MARTIN.OJB_DMAP_ENTRIES" ist ein nicht definierter Name. SQLSTATE=42704 [torque-insert-sql] Failed to execute: CREATE TABLE OJB_DMAP_ENTRIES ( ID INTEGER NOT NULL, DMAP_ID INTEGER NOT NULL, KE Y_OID VARCHAR(250) FOR BIT DATA VARCHAR(n) FOR BIT DATA, VALUE_OID VARCHAR(250) FOR BIT DATA VARCHAR(n) FOR BIT DATA ) [torque-insert-sql] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0104N Auf "AR(250) FOR BIT DATA" folgte das unerwartete Token "VARCHAR". Zu den m÷glichen Token geh÷ren: "REFERENCES". SQLSTATE=42601 [torque-insert-sql] Failed to execute: ALTER TABLE OJB_DMAP_ENTRIES ADD PRIMARY KEY (ID) [torque-insert-sql] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0204N "MARTIN.OJB_DMAP_ENTRIES" ist ein nicht definierter Name. SQLSTATE=42704 [torque-insert-sql] Executing file: H:\db-ojb-1.0.rc4\target\src\sql\ojbtest-data.sql [torque-insert-sql] 461 of 464 SQL statements executed successfully junit-no-compile-no-prepare: [junit] Running org.apache.ojb.broker.AllTests [junit] Tests run: 247, Failures: 1, Errors: 0, Time elapsed: 32,578 sec [junit] TEST org.apache.ojb.broker.AllTests FAILED [junit] Running org.apache.ojb.odmg.AllTests [junit] [BOOT] INFO: OJB.properties: file:/H:/db-ojb-1.0.rc4/target/test/ojb/OJB.properties [junit] Tests run: 160, Failures: 0, Errors: 1, Time elapsed: 11,703 sec [junit] TEST org.apache.ojb.odmg.AllTests FAILED [junit] Running org.apache.ojb.soda.AllTests [junit] [BOOT] INFO: OJB.properties: file:/H:/db-ojb-1.0.rc4/target/test/ojb/OJB.properties [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 1,734 sec [junit] Running org.apache.ojb.otm.AllTests [junit] Tests run: 73, Failures: 0, Errors: 0, Time elapsed: 11,453 sec from tests-broker.txt: Testcase: testDeleteWithRemovalAwareCollection took 0,047 sec FAILED expected:<1> but was:<0> junit.framework.AssertionFailedError: expected:<1> but was:<0> at org.apache.ojb.broker.OneToManyTest.testDeleteWithRemovalAwareCollection (OneToManyTest.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) from tests-odmg.txt Testcase: testAdding took 0,047 sec Caused an ERROR [IBM][CLI Driver][DB2/NT] SQL0204N "MARTIN.OJB_DMAP_ENTRIES" ist ein nicht definierter Name. SQLSTATE=42704 org.odmg.LockNotGrantedException: [IBM][CLI Driver][DB2/NT] SQL0204N "MARTIN.OJB_DMAP_ENTRIES" ist ein nicht definierter Name. SQLSTATE=42704 at org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:297) at org.apache.ojb.odmg.collections.DMapImpl.put(DMapImpl.java:198) at org.apache.ojb.odmg.DMapTest.testAdding(DMapTest.java:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: generating DDL from repository.xml
I use the following xsl to convert the repository file to torque-style schema. It handles indexes and foreign keys. For indexes you have to add an index attribute to the field descriptors. For this project every class has an cld for an interface and then a cld for the implementation with all the fields, so if you have a different setup you may have to adjust this. I think this should work with Torque as well, but we use a patched version of commons-sandbox/sql to do the ddl. If you just want to create full create ddl from an ant task then the code in cvs is good enough. I patched it to allow creation of ddl that will alter an existing db to bring it up to date with the current schema. It also allows you to do this from code and not just ant, so we actually ensure the db is up-to-date on each startup via the factory that configures OJB. I submitted the patch but it was never taken. If you search the commons-dev archives you can find it. Here's how our repository looks: John Marshall Connectria >= Original Message From Eli Anderson <[EMAIL PROTECTED]> = >Dave, > >download the contrib.tgz file and take a look at the ojb module for >xdoclet. I haven't tried it for generating the torque XML file but when >I read the documentation it appears to have the functionality you want. > > > > >On Mon, 2003-08-04 at 16:11, Durham David Contr 805 CSS/SCBE wrote: >> I would like to generate the DDL from the class-definitions in >> repository.xml. I see that the unit tests that come with OJB use Torque >> to generate DDL. Is there a way to take the repository.xml and run it >> through Torque? It seems like a transformation might be in order to >> take the data from the repository.xml format and put it in Torque's >> format. (As you may be able to tell, I'm not very experienced with XML) >> I'm wondering if anyone else on the list has a solution for this >> problem. >> >> Thanks, >> >> >> Dave >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >-- >Eli Anderson > > >--=-XZqpeUFzQyBxcp2QpDbT >Content-Type: application/pgp-signature; name=signature.asc >Content-Description: This is a digitally signed message part > >-BEGIN PGP SIGNATURE- >Version: GnuPG v1.2.1 (GNU/Linux) > >iD8DBQA/Lx2UKBM7jJD0qewRAjcvAKDHtkcRgxxff7R3kf73uXjlupzceACeNNke >76HeZnITOFVOoh461U87d3w=NCE+ >-END PGP SIGNATURE- > >--=-XZqpeUFzQyBxcp2QpDbT-- http://www.w3.org/1999/XSL/Transform"; version="1.0" xmlns:xalan="http://xml.apache.org/xslt";> true false true index__ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]