I am in the process of trying to use the JDO API as well, though just beginning. I had some similar questions when I started, though I had not used ODMG. I have gotten it far enough that my application is now sending sql to the database (though it is failing due to the fact I havn't initialized the tables yet, but that is the expected behavior right now). Here are some key things I have found so far.
1 You do need a repository.xml with a repository_users.xml included, a repository_database.xml that specifies things like your db driver and the repository_internal to tell the ojb mechanisms that sit behind the JDO facade what your database looks like.
2. You do need .jdo file(s) as well for your enhancer. These files *are* quite similar to repository-user and duplicate a lot of information.
3. Xdoclet can be used to generate both of these configuration files at build time. This was fairly easy and I highly reccomend it. Using Xdoclet will put all the information in javadoc like tags in your source code file, so that you only ever edit the source, rather than editing the source and then two xml files and hope that your edits all match.
4. The database can be initialized via Torque and a project_schema.xml which can also be generated by Xdoclet without any additional tags. I am currently pursuing a slightly more elegant solution that allows updating of the database in place as well, but you may not need that. See my recent thread titled: "Auto create tables in the DB"
Hope this helps, Gus
Franz-Josef Herpers wrote:
Hi,
As with the ODMG-Implementation I'm trying now to adapt the JDO tutorial examples for my own application.
I successfully enhanced one class and defined a mapping in a jdo-File. As far as I understand I need still a repository_database.xml to specify my default DB-Connection. If I don't do it I get an error message that default is not specified.
OK, but if I specify the default connection, OJB still wants a mapping definition for my table-class-mapping in the repository_user.xml. But there is already a mapping defined in my jdo-file.
Can someone spread some light upon the relationship between the repository.xml-stuff and the jdo-files. The tutorial only states
"TODO: Put information about the .jdo files".
Thanks in advance Franz
--------------------------------------------------------------------- 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]
