RE: AW: AW: Is OJB the right solution?
From a general load perspective, maybe a better solution would be to look at the utilities offered in the Jakarta Commons BeanUtils package http://jakarta.apache.org/commons/beanutils.html it has some interesting ways to automatically load beans using reflection and the JAVA beans specification directly through JDBC. - Dan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, October 16, 2003 10:14 AM To: OJB Users List Subject: Re: AW: AW: Is OJB the right solution? Here is a solution that might work: Establish a JDBC connection to your customer database and set the connection in the repository.xml of OJB. Map the tables in the customer database to your Java objects using repository_user.xml of OJB Run an OJB query loading your Java objects. Done Christian Plate [EMAIL PROTECTED] 10/16/2003 09:48 AM Please respond to OJB Users List To: 'OJB Users List' [EMAIL PROTECTED] cc: Subject:AW: AW: Is OJB the right solution? We can't use these tools. The databases from which we have to import data are databases of our customers. So the formats differ and we need an easy to automatize way of importing. Besides we don't want to import into another Database but into our Objectmodel. Christian I don't think OJB is the way to go for you. Why don't you use the RDBMS bulk load utility? Giora Christian Plate [EMAIL PROTECTED] 10/16/2003 09:23 AM Please respond to OJB Users List To: 'OJB Users List' [EMAIL PROTECTED] cc: Subject:AW: Is OJB the right solution? I'll explain our situation in more detail: We have an existing infrastructure of Components (EJBs) and an underlying Database. Persistance of these Components is achieved 'traditionally' (without O/R - Mapping tools). We want to import Data from other Datasources (Access / CSV / Oracle,...) into our System. This means we don't need an persistance layer. But we need an comfortable (configurable/generic) way of importing this Data into our existing Objectmodel. Basically we want to say 'import TableA.fieldA to ObjectB.fieldA' All we need is a generic 'loading facility'. I'm not sure if OJB is the right tool for this purpose. Thanks for helping! Christian Plate -Ursprüngliche Nachricht- Von: Brian McCallister [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 16. Oktober 2003 15:04 An: OJB Users List Betreff: Re: Is OJB the right solution? Just from the description you gave it is likely that OJB would help solve a lot of your problems, but I am not sure without details. By import do you mean use multiple datasources for the application to materialize the same type of object, or do you mean import data from one schema (in database one) into database two, using database two's schema. I think you mean the first situation -- and can say with a definite yes that OJB can work well for you. You will need to be careful about object relationships across datasource boundaries... hmm, fun problem. -Brian On Thursday, October 16, 2003, at 04:06 AM, Christian Plate wrote: Hi! After much reading i'm still not quite sure if OJB is the right solution for our problem. We have an existing Objectmodel and underlying Database. Now we want to import data from other Datasources. These Datasources have different Structures. So we thought it would be a good idea to find a generic solution. The specification of a mapping through XML is excactly what we need. My Question is if OJB is the right solution for this 'Import-Scenario'. Should i look for something different? Thanks in advance! Christian Plate - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The information in this e-mail, and any attachment therein, is confidential and for use by the addressee only. If you are not the intended recipient, please return the e-mail to the sender and delete it from your computer. Although The Bank of New York attempts to sweep e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses. The information in this e-mail, and any attachment therein, is confidential and for use by the addressee only. If you are not the intended recipient, please return the e-mail to the sender and delete it from your computer. Although The Bank of New York attempts to sweep e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses. - To unsubscribe, e-mail:
Using functions in select attribute list
I have a query that I would like to construct that will return a desired class. The query is constructed in such a way that only one row will be returned but it requires that I use a function in the column definition of the sql statement. Here is the example sql: select value, max(code), column from table where value = 1 and code 1 From what I can gather from the documentation. I can add a function when building the criteria. But that only puts the max(code) statement in the where clause. How would I use OJB to put the function in the attribute list and not in the where clause get the desired object? or row? I am using the Persistent Broker API. Thanks - Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Compound Primary Key foreign key references
All, From what I can tell, the repository.dtd is not sufficient to uniquely reference an object with a compound primary key. I think I must be missing something. In the contrived example below the foreign keys used to reference class B are keyA and keyB. Unfortunately, the names of keyA and keyB are NOT the same names inside classB. How do I configure refB to tell it that keyA references classB.secondKey and that keyB references classB.firstKey or vica-versa. I am a little unclear on how to make the distinction explicit. Any help will be appreciated. - Dan class-descriptor class=mypackage.ClassA table=tableA field-descriptor name=id column=id jdbc-type=INTEGER primarykey=true / field-descriptor name=keyA column=keyA jdbc-type=INTEGER / field-descriptor name=keyB column=keyB jdbc-type=INTEGER / reference-descriptor name=refB class-ref=mypackage.ClassB foreignkey field-ref=keyA/ foreignkey field-ref=keyB/ /reference-descriptor /class-descriptor class-descriptor class=mypackage.ClassB table=tableB field-descriptor name=firstKey column=firstKey jdbc-type=INTEGER primarykey=true / field-descriptor name=secondKey column=secondKey jdbc-type=INTEGER primarykey=true / /class-descriptor __ Daniel B. Brown | WELLS FARGO BANK MINNESOTA, N.A. | Software Architect | http://www.wellsfargo.com | MAC N2702-011 | 9062 Old Annapolis Road | Columbia | MD | 21045-1951 | p: 410.884.2034 | f: 410.715.2325 | [EMAIL PROTECTED] | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Compound Primary Key foreign key references
My question was the later. I could not find the behavior in the documentation. Thanks, - Dan -Original Message- From: Ron Gallagher [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2003 9:53 AM To: OJB Users List Subject: Re: Compound Primary Key foreign key references Dan -- Are you asking this question because you've tried this configuration and it doesn't work, or are you just confused as to how OJB will handle this situation? If the former, then please provide more info regarding the problems you're having. If the latter, then here's my explanation... Anytime ojb encounters a reference-descriptor, it matches up the foreignkey elements, one for one, with the primary key field-descriptors in the referenced class. This matching process pairs up foreignkey and field-descriptor elements in the same order that they appear in the repository. So, in your case, the property mypackage.ClassA::keyA will be matched up with the property mypackage.ClassB::firstKey, and the property mypackage.ClassA::keyB will be matched up with the property mypackage.ClassB::secondKey Ron Gallagher Atlanta, GA [EMAIL PROTECTED] From: [EMAIL PROTECTED] Date: 2003/08/18 Mon AM 09:01:37 EDT To: [EMAIL PROTECTED] Subject: Compound Primary Key foreign key references All, From what I can tell, the repository.dtd is not sufficient to uniquely reference an object with a compound primary key. I think I must be missing something. In the contrived example below the foreign keys used to reference class B are keyA and keyB. Unfortunately, the names of keyA and keyB are NOT the same names inside classB. How do I configure refB to tell it that keyA references classB.secondKey and that keyB references classB.firstKey or vica-versa. I am a little unclear on how to make the distinction explicit. Any help will be appreciated. - Dan class-descriptor class=mypackage.ClassA table=tableA field-descriptor name=id column=id jdbc-type=INTEGER primarykey=true / field-descriptor name=keyA column=keyA jdbc-type=INTEGER / field-descriptor name=keyB column=keyB jdbc-type=INTEGER / reference-descriptor name=refB class-ref=mypackage.ClassB foreignkey field-ref=keyA/ foreignkey field-ref=keyB/ /reference-descriptor /class-descriptor class-descriptor class=mypackage.ClassB table=tableB field-descriptor name=firstKey column=firstKey jdbc-type=INTEGER primarykey=true / field-descriptor name=secondKey column=secondKey jdbc-type=INTEGER primarykey=true / /class-descriptor __ Daniel B. Brown | WELLS FARGO BANK MINNESOTA, N.A. | Software Architect | http://www.wellsfargo.com | MAC N2702-011 | 9062 Old Annapolis Road | Columbia | MD | 21045-1951 | p: 410.884.2034 | f: 410.715.2325 | [EMAIL PROTECTED] | - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
reverse-db and reversedb2
All, I noticed these targets in the build.xml file. Do these applications work in that I can select tables from my existing database and have it generate the initial XML config file for OJB? If so, which one is best? I have tried to play with them with no success. __ Daniel B. Brown | WELLS FARGO BANK MINNESOTA, N.A. | Software Architect | http://www.wellsfargo.com | MAC N2702-011 | 9062 Old Annapolis Road | Columbia | MD | 21045-1951 | p: 410.884.2034 | f: 410.715.2325 | [EMAIL PROTECTED] | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: reverse-db and reversedb2
I could not get either reverse-db version working using our MSSqlServer 7 databases. But I did come across this an OJB tool for eclipse that looks promising (http://www.impart.ch/download.htm). It seems to generate the repository*.xml and java files that I need. I will be testing it today to see if the generated output works. Only problem is that I had to install eclipse to use it since it is a plugin and I don't know how to invoke it outside of the tool. But the investment time is only an hour or two verses 3 to 4 days for the suggested approach below. - Dan -Original Message- From: Danilo Tommasina [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 3:42 AM To: OJB Users List Subject: Re: reverse-db and reversedb2 Hi, All, I noticed these targets in the build.xml file. Do these applications work in that I can select tables from my existing database and have it generate the initial XML config file for OJB? If so, which one is best? I have tried to play with them with no success. We are also using reverse engineering, our db model is very large and complex and we have a good db-design tool, so we prefere to adopt this way... I got a look to reverse-db tools, however i have the impression they are still too 'young' and doesn't give me enough freedom on the model generation process. If you look into the build-torque.xml ant script, you will find targets for generating repository and model from a jdbc connection. However I started with RC3 and the velocity templates used for the repository/java code generation were still quite buggy (Maybe they are better now in RC4). I did several modification, so now we can generate the repository and the java code formatted as we want and with several useful features already added to the model classes. Drawback is that the templates we are using now are no longer globally usable :( but we spare lot of time, everytime there is a change in the database model. So if you have the possibility to invest 3 or 4 days, you can adapt the velocity templates (and maybe the ant script) to your application. In our case, for every db-table we have 2 classes, a base class that is always regenerated by the build script and only defines the setters/getters and a couple of constructors, the second class extends the base one and is only created once, in this class you can put some more code to simplify access to the data (conversions and other utility methods) hope i helped you bye danilo - 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]
Compile for JDK 1.3?
I am following the quickstart.html directions and trying to run bin\build junit using JDK 1.3.1. It looks like a targeted effort was made to get this work with JDKs other than 1.4. However, the compile fails due to a dependency on a JDK 1.4 class. Is this a bug? or must we use JDK 1.4 or better. The stack trace is as follows: C:\db-ojb-1.0.rc4bin\build junit Buildfile: build.xml splash: set-archive-name: set-archive-name-date: detect-jdk: check-jdk12proxy-classes: check-jndi-classes: use-jdk12: use-jdk13: [echo] detected JDK 1.3 use-jdk14: init: prepare: [copy] Copying 586 files to C:\db-ojb-1.0.rc4\target\src [copy] Copying 259 files to C:\db-ojb-1.0.rc4\target\srctest [copy] Copying 10 files to C:\db-ojb-1.0.rc4\target\srcjca check-j2ee-classes: preprocess: [echo] using switches: +JDK13, -JDBC30 [java] . [java] ... main: [javac] Compiling 549 source files to C:\db-ojb-1.0.rc4\target\classes [javac] C:\db-ojb-1.0.rc4\target\src\org\apache\ojb\otm\copy\MetadataObjectC opyStrategy.java:69: cannot resolve symbol [javac] symbol : class IdentityHashMap [javac] location: package util [javac] import java.util.IdentityHashMap; [javac] ^ [javac] C:\db-ojb-1.0.rc4\target\src\org\apache\ojb\otm\copy\ReflectiveObjec tCopyStrategy.java:68: cannot resolve symbol [javac] symbol : class IdentityHashMap [javac] location: package util [javac] import java.util.IdentityHashMap; [javac] ^ [javac] C:\db-ojb-1.0.rc4\target\src\org\apache\ojb\otm\copy\MetadataObjectC opyStrategy.java:100: cannot resolve symbol [javac] symbol : class IdentityHashMap [javac] location: class org.apache.ojb.otm.copy.MetadataObjectCopyStrategy [javac] return clone(obj, new IdentityHashMap(), broker); [javac] ^ [javac] C:\db-ojb-1.0.rc4\target\src\org\apache\ojb\otm\copy\ReflectiveObjec tCopyStrategy.java:108: cannot resolve symbol [javac] symbol : class IdentityHashMap [javac] location: class org.apache.ojb.otm.copy.ReflectiveObjectCopyStrategy [javac] return clone(toCopy, new IdentityHashMap(), new HashMap( )); [javac] ^ [javac] 4 errors BUILD FAILED file:C:/db-ojb-1.0.rc4/build.xml:218: Compile failed; see the compiler error out put for details. Total time: 1 minute 9 seconds __ Daniel B. Brown | WELLS FARGO BANK MINNESOTA, N.A. | Software Architect | http://www.wellsfargo.com | MAC N2702-011 | 9062 Old Annapolis Road | Columbia | MD | 21045-1951 | p: 410.884.2034 | f: 410.715.2325 | [EMAIL PROTECTED] | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]