RE: ojbdoclet task in ant build.xml

2004-01-07 Thread De Swert Pierre (GFDI)

> -Original Message-
> From: Thomas Dudziak [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, 31 December, 2003 11:12 AM
> To: OJB Users List
> Subject: Re: ojbdoclet task in ant build.xml
> 
> >  
> > 1.How to avoid editing the project-schema generated via ojb doclets?
> > I have to replace
"http://jakarta.apache.org/turbine/dtd/database.dtd
> >  " with 
> > "src/schema/database.dtd", otherwise ...
> > 
> >[torque-sql] Using contextProperties file:
> > E:\Workspaces\pds\myproject\build.properties
> >[torque-sql] Using classpath
> >[torque-sql] Generating to file 
> > E:\Workspaces\pds\myproject\src\sql\report.myproject.sql.generation
> >[torque-sql] Parsing file: 'myproject-schema.xml'
> >[torque-sql] (transform.DTDResolver   140 ) Resolver:
> > usedhttp://jakarta.apache.org/turbine/dtd/database.dtd
> >[torque-sql] (transform.DTDResolver   160 ) Couldn't
read
> > DTD specified in XML schema: 
> >[torque-sql] java.net.UnknownHostException: jakarta.apache.org
> 
> This is a known problem with some XML parsers. There is an (for
whatever reason yet undocumented)
> attribute of the torque sub task called 'dtdUrl' that allows to
specify the url of the dtd
> in the build file.

I am trying to fix this in my ant builds, but...

1. Which version(s) of the XML Parser is suitable for torque? I have got
the same error with Xerces 2.6.0 (the latest version).

2. I am using torque, version 3.0.2 and apparently the 'dtdUrl'
attribute is not known...
   If I edit the build-torque.xml as follows...


  

  


   the torque task complains that it does not support the "dtdurl"
attribute.

prepare-db:

project-sql-classpath:
 [echo] +--+
 [echo] |  |
 [echo] | Generating SQL for OJB Testsuite!|
 [echo] | enJoy!   |
 [echo] |  |
 [echo] +--+
[torque-sql] Using contextProperties file:
E:\Workspaces\pds\myproject\build.properties

BUILD FAILED
  E:/Workspaces/pds/myproject/build-torque.xml:454: The
 task doesn't support
the "dtdurl" attribute.

   Do I need a more recent version of torque to use the "dtdurl"
attribute?

Best regards,

Pierre

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to specify nested fields with ojb xdoclet?

2004-01-06 Thread De Swert Pierre (GFDI)
I am eagerly waiting the version of the XDoclet module supporting nested
objects...
The syntax looks very nice.

A question about the @ojb.modify-nested tag. Potentially, an object can
embed many instances of the same class.
For instance, a SimpleCustomer object can hold a billing and shipping
address.
A specific mapping attribute name - column name should be specified at
the nesting class level.
I would like to know if the @ojb.modify-nested tag will allow me specify
an alternate column name to deal with multiple nested objects of the
same class?

I would like to write things such as...

   /**
 * @ojb.class table="SIMPLE_CUSTOMER"
 */
public class SimpleCustomer implements java.io.Serializable
{
/**
 * @ojb.nested
 * @ojb.modify-nested name="streetName"
 *column="SHIPPING_STREET_NAME"
 * @ojb.modify-nested name="streetNumber"
 *column="SHIPPING_STREET_NUMBER"
 * @ojb.modify-nested name="zip"
 *column="SHIPPING_ZIP_CODE"
 */
protected Address shippingAddress;

// or better... :-)
/**
 * @ojb.nested
 * @ojb.modify-nested name="*"
 *column="BILLING_*"
 */
protected Address billingAddress;
/** @ojb.field column="NAME" */
protected String name;
...
}

Pierre

-Original Message-
From: Thomas Dudziak [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 06 January, 2004 11:33 AM
To: OJB Users List
Subject: Re: How to specify nested fields with ojb xdoclet?


The XDoclet module does not yet support nested objects, but it will in
the next release (end of january), perhaps even in the OJB 1.0 final.
The syntax will look like this (minor changes are possible):

/**
 * @ojb.class table="CONTACT_PERSON"
 */
public class ContactPerson implements java.io.Serializable
{
/** @ojb.nested */  
protected Address address;
/** @ojb.field column="NAME" */
protected String name;
...
}

/**
 * Note that ojb.class is not necessary here for the nesting
 * though the individual ojb.field tags are.
 */
public class Address implements java.io.Serializable {
/** @ojb.field column="STREET_NAME" */
protected String streetName
/** @ojb.field column="STREET_NUMBER" */
protected String streetNumber
/** @ojb.field column="ZIP_CODE" */
protected String zip;
...

}

This will result in something like (note the ordering):






...


To change the ordering or ignore fields you could modify the nested
fields like this:

/**
 * @ojb.class table="CONTACT_PERSON"
 */
public class ContactPerson implements java.io.Serializable
{
/**
 * @ojb.nested
 * @ojb.modify-nested name="streetName"
 *id="2"
 * @ojb.modify-nested name="streetNumber"
 *id="3"
 * @ojb.modify-nested name="zip"
 *ignore="true"
 */
protected Address address;
/**
 * @ojb.field column="NAME"
 *id="1"
 */
protected String name;
...
}

which results in





...


(This is a slightly contrieved example of the modify-nested tag as it
would suffice to use id for the "name" field).

Tom




-
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]



How to specify nested fields with ojb xdoclet?

2004-01-06 Thread De Swert Pierre (GFDI)
Hi all,

 

I would like to know how to specify a nested field using ojb xdoclet.

I have not found in the doc how to do it.

 

To illustrate my question, I propose the class Address of which the
instances can be nested in different classes, but I have got many
classes that I would like to make embeddable. An Address in this case is
nested in a ContactPerson.

 

 

/**

 * @ojb.class table="CONTACT_PERSON"

 *documentation="The nesting class."

 */

public class ContactPerson implements java.io.Serializable {

  /**

   * @ojb.field 

   *

   */  

protected Address address; /* nested object of a contact person */

protected String name;

protected String firstname;

...

}

 

/**

 * @ojb.class  

 *documentation="The nested class."

 */

public class Address implements java.io.Serializable {

protected String streetName

protected String streetNumber

protected String zip;

...

}

 

I would like to generate a repository.xml file that includes a mapping
specifying attributes of the nested object. Of course I do not want to
manually edit the generated mapping.

 

   

  

 

  ...

 

  

 

  

 

  

 

 

Many thanks for your help,

 

Pierre

 

 

 



RE: ojbdoclet task in ant build.xml

2003-12-31 Thread De Swert Pierre (GFDI)

> From: Thomas Dudziak [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, 31 December, 2003 11:12 AM
> To: OJB Users List
> Subject: Re: ojbdoclet task in ant build.xml
> 
> On Wed, 31 Dec 2003, De Swert Pierre (GFDI) wrote:
> 
> > I have reused the ant build files of the ojb-blank project to build
my 
> > own things. I have added a target to produce an ojb repository and a

> > project schema via ojb doclets, a target to generate the database by

> > means of torque (by the way, the repository.xml file is missing in
the 
> > ojb-blank project).
> 
> If you mean that the file generated by the XDoclet OJB module misses
the OJB core tables, then you are
> right, but this is on purpose. The module only generates the
repository_user.xml part (see the OJB unit 
> tests for the proposed structure of the repository xml files).

I mean that the src/resources directory of the ojb-blank project does
not contain a repository.xml file.
The src/resources directory contains the following files:

commons-logging.properties
log4j.properties
OJB.properties
repository.dtd
repository_database.xml
repository_ejb.xml
repository_internal.xml
repository_jdo.xml
repository_junit.xml
repository_junit_cloneable.xml
repository_junit_meta_seq.xml
repository_junit_model.xml
repository_junit_odmg.xml
repository_junit_otm.xml
repository_junit_reference.xml
repository_user.xml
simplelog.properties
spy.properties
testsuite-spy.properties

Maybe it does not contain the repository.xml file purposely or it could
be a build problem...

Pierre

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ojbdoclet task in ant build.xml

2003-12-31 Thread De Swert Pierre (GFDI)
I have reused the ant build files of the ojb-blank project to build my
own things. I have added a target to produce an ojb repository and a
project schema via ojb doclets, a target to generate the database by
means of torque (by the way, the repository.xml file is missing in the
ojb-blank project). But the result is not yet satisfactory. 
 
1.How to avoid editing the project-schema generated via ojb doclets?  I
have to replace "http://jakarta.apache.org/turbine/dtd/database.dtd
 " with
"src/schema/database.dtd", otherwise ...

   [torque-sql] Using contextProperties file:
E:\Workspaces\pds\myproject\build.properties
   [torque-sql] Using classpath
   [torque-sql] Generating to file
E:\Workspaces\pds\myproject\src\sql\report.myproject.sql.generation
   [torque-sql] Parsing file: 'myproject-schema.xml'
   [torque-sql] (transform.DTDResolver   140 ) Resolver:
usedhttp://jakarta.apache.org/turbine/dtd/database.dtd
   [torque-sql] (transform.DTDResolver   160 ) Couldn't read
DTD specified in XML schema: 
   [torque-sql] java.net.UnknownHostException: jakarta.apache.org
 
2. Is it possible to configure the ojbdoclet task to generate the ojb
repository and torque schema in to different directories?
 
3. Is it fitting to generate the ojb repository in src/resources and
torque schema in src/schema?
 
Many Thanks and happy New Year!
 
Pierre


RE: Sample ant build files for OJB?

2003-12-22 Thread De Swert Pierre (GFDI)
Hi Thomas,

Apparently I have got a problem of  j2ee versions. There is a j2ee.jar
on the classpath, but one that is delivered with the release IBM's
websphere we are using and that does not contain the connector API! I
have downloaded the latest j2ee SDK this morning. If I use the j2ee.jar
of the j2ee SDK 1.4 instead of the j2ee.jar of IBM, the obj-blank target
is build as expected.

By the way, for the final release it would be GREAT if targets to build
the repository_user.xml using doclets and to generate a database by
means of torque were included in the build.xml of the ojb-blank project.
It would simplify the life of OJB newbies like me. For the moment I am
struggling with torque... (nicht ganz einfach...)

Many thanks for your help,

Pierre

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, 19 December, 2003 5:37 PM
To: OJB Users List
Subject: Re: Sample ant build files for OJB?


Hi Pierre,

we have a dependency against several j2ee APIs. Our recommendation is to

  have the j2ee.jar on the classpath.
During the build we check against certain classes an print out a warning

to include the j2ee.jar, if those classes are not present.

I guess this should be safe enough for most cases.

Thomas

De Swert Pierre (GFDI) wrote:
> Hi Thomas,
> 
> Many thanks for your help. I have successfully built the ojb-blank.jar

> library to start my project. I needed to add the Sun's 
> connector-api.jar in /lib, otherwise the main-opt target fails.
> Apparently the connector-api.jar library is not listed in the
libraries
> needed to deploy OJB.
> 
> Pierre
> 
> -Original Message-
> From: Mahler Thomas [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, 17 December, 2003 5:53 PM
> To: 'OJB Users List'
> Subject: RE: Sample ant build files for OJB?
> 
> 
> This should get you started: 
> http://db.apache.org/ojb/getting-started.html
> 
> 
>>-Original Message-
>>From: De Swert Pierre (GFDI) [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, December 17, 2003 10:33 AM
>>To: OJB Users List
>>Subject: Sample ant build files for OJB?
>>
>>
>>Hi all,
>> 
>>I have recently downloaded OJB r5 and I try to apply it to my own
>>project. Running the tutorials was quite simple but deploying OBJ for 
>>my project is not quite straightforward. I am currently loosing
>>my time by
>>adapting the ant build of my project. So I decided to 
>>subscribe to this
>>mailing list... ;) Loads of targets are defined in the ant build files
>>(build.xml, build-torque.xml...) provided with OJB. I would like to
>>extract only the targets required to build the repository.xml 
>>using ojb
>>xdoclet and build the database using the torque stuff. I would be
>>grateful for receiving simple ant builds and the related dot 
>>properties
>>files that I could use as an example. Many thanks for your help.
>> 
>>Pierre
>>[EMAIL PROTECTED] <mailto:[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]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Sample ant build files for OJB?

2003-12-18 Thread De Swert Pierre (GFDI)
Hi Thomas,

Many thanks for your help. I have successfully built the ojb-blank.jar
library to start my project. 
I needed to add the Sun's connector-api.jar in /lib, otherwise the
main-opt target fails.
Apparently the connector-api.jar library is not listed in the libraries
needed to deploy OJB.

Pierre 

-Original Message-
From: Mahler Thomas [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 17 December, 2003 5:53 PM
To: 'OJB Users List'
Subject: RE: Sample ant build files for OJB?


This should get you started:
http://db.apache.org/ojb/getting-started.html

> -Original Message-
> From: De Swert Pierre (GFDI) [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 17, 2003 10:33 AM
> To: OJB Users List
> Subject: Sample ant build files for OJB?
> 
> 
> Hi all,
>  
> I have recently downloaded OJB r5 and I try to apply it to my own 
> project. Running the tutorials was quite simple but deploying OBJ for 
> my project is not quite straightforward. I am currently loosing
> my time by
> adapting the ant build of my project. So I decided to 
> subscribe to this
> mailing list... ;) Loads of targets are defined in the ant build files
> (build.xml, build-torque.xml...) provided with OJB. I would like to
> extract only the targets required to build the repository.xml 
> using ojb
> xdoclet and build the database using the torque stuff. I would be
> grateful for receiving simple ant builds and the related dot 
> properties
> files that I could use as an example. Many thanks for your help.
>  
> Pierre
> [EMAIL PROTECTED] <mailto:[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]



Sample ant build files for OJB?

2003-12-17 Thread De Swert Pierre (GFDI)
Hi all,
 
I have recently downloaded OJB r5 and I try to apply it to my own
project. Running the tutorials was quite simple but deploying OBJ for my
project is not quite straightforward. I am currently loosing my time by
adapting the ant build of my project. So I decided to subscribe to this
mailing list... ;) Loads of targets are defined in the ant build files
(build.xml, build-torque.xml...) provided with OJB. I would like to
extract only the targets required to build the repository.xml using ojb
xdoclet and build the database using the torque stuff. I would be
grateful for receiving simple ant builds and the related dot properties
files that I could use as an example. Many thanks for your help.
 
Pierre
[EMAIL PROTECTED]