RE: Progress ?

2004-02-24 Thread eric barbe
Hi,

What do you mean with "you will have to generate the schema from Progress" ?
Does it mean that the driver does not support DDL ?

Thanks

Éric

-Message d'origine-
De : Mark Berry [mailto:[EMAIL PROTECTED]
Envoyé : lundi 23 février 2004 21:13
À : OJB Users List
Objet : Re: Progress ?


There are no free ones that I am aware of.
V9.1 Ships with one that works very well with OJB.
Unfortunatly you will have to generate the schema from Progress.

Regards

Mark

- Original Message -----
From: "eric barbe" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 24, 2004 6:23 AM
Subject: RE: Progress ?


> JDBC driver exists, but is there a free version ?
> And does it work with OJB ?
>
> Thanks
>
> Éric
>
> -Message d'origine-
> De : eric barbe [mailto:[EMAIL PROTECTED]
> Envoyé : lundi 23 février 2004 17:52
> À : OJB
> Objet : Progress ?
>
>
> Hi,
>
> I want to know if somebody has worked with OJB and Progress V 8.
> If yes, can this persons give me where to found the jdbc driver and mail
us
> the repository.
>
> Thanks,
>
> Éric
>
>
> -
> 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: Progress ?

2004-02-23 Thread eric barbe
JDBC driver exists, but is there a free version ?
And does it work with OJB ?

Thanks

Éric

-Message d'origine-
De : eric barbe [mailto:[EMAIL PROTECTED]
Envoyé : lundi 23 février 2004 17:52
À : OJB
Objet : Progress ?


Hi,

I want to know if somebody has worked with OJB and Progress V 8.
If yes, can this persons give me where to found the jdbc driver and mail us
the repository.

Thanks,

Éric


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



Progress ?

2004-02-23 Thread eric barbe
Hi,

I want to know if somebody has worked with OJB and Progress V 8.
If yes, can this persons give me where to found the jdbc driver and mail us
the repository.

Thanks,

Éric


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



RE: Date problem ?

2004-01-16 Thread eric barbe
Thanks, it works fine !

-Message d'origine-
De : Hennebelle [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 15 janvier 2004 09:26
À : 'OJB Users List'
Objet : RE: Date problem ?


Hi,

Have you try to use TIMESTAMP for your jdbc-type,
you can try like this :



The class for the conversion is already define in OJB.

Hope that help.

-Message d'origine-
De : eric barbe [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 15 janvier 2004 09:22
À : OJB Users List
Objet : RE: Date problem ?


Does somebody have an idea ?

Thanks

Éric

-Message d'origine-
De : eric barbe [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 14 janvier 2004 17:44
À : [EMAIL PROTECTED]
Objet : Date problem ?


Hi everybody,

I'm working under Oracle 8i.

In my repository_user.xml, i have amongst other things this class descriptor


   
   
   


where the Calendate2DateFieldConversion looks like following :

/*
 * Created on 19 nov. 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package MyPackage;

import java.sql.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;

import org.apache.ojb.broker.accesslayer.conversions.FieldConversion;

/**
 * @author ghd
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class Calendar2DateFieldConversion implements FieldConversion {
/**
 * @see FieldConversion#javaToSql(Object)
 */
public Object javaToSql(Object source)
{
if (source instanceof Calendar)
{
return new Date(((Calendar) source).getTimeInMillis());
}
else
{
return source;
}
}

/**
 * @see FieldConversion#sqlToJava(Object)
 */
public Object sqlToJava(Object source)
{
if (source instanceof Date)
{
GregorianCalendar cal = new GregorianCalendar();
cal.setTimeInMillis(((Date)source).getTime());
return cal;
}
else
{
return source;
}
}
}

my problemn is that the date are stored without the hour informations under
Oracle. It works fine with SQL Server. :-(

Does somebody knows about this problem ?

Regards.

Éric


-
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: Date problem ?

2004-01-15 Thread eric barbe
Does somebody have an idea ?

Thanks

Éric

-Message d'origine-
De : eric barbe [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 14 janvier 2004 17:44
À : [EMAIL PROTECTED]
Objet : Date problem ?


Hi everybody,

I'm working under Oracle 8i.

In my repository_user.xml, i have amongst other things this class descriptor


   
   
   


where the Calendate2DateFieldConversion looks like following :

/*
 * Created on 19 nov. 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package MyPackage;

import java.sql.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;

import org.apache.ojb.broker.accesslayer.conversions.FieldConversion;

/**
 * @author ghd
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class Calendar2DateFieldConversion implements FieldConversion {
/**
 * @see FieldConversion#javaToSql(Object)
 */
public Object javaToSql(Object source)
{
if (source instanceof Calendar)
{
return new Date(((Calendar) source).getTimeInMillis());
}
else
{
return source;
}
}

/**
 * @see FieldConversion#sqlToJava(Object)
 */
public Object sqlToJava(Object source)
{
if (source instanceof Date)
{
GregorianCalendar cal = new GregorianCalendar();
cal.setTimeInMillis(((Date)source).getTime());
return cal;
}
else
{
return source;
}
}
}

my problemn is that the date are stored without the hour informations under
Oracle. It works fine with SQL Server. :-(

Does somebody knows about this problem ?

Regards.

Éric


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



Date problem ?

2004-01-14 Thread eric barbe
Hi everybody,

I'm working under Oracle 8i.

In my repository_user.xml, i have amongst other things this class descriptor


   
   
   


where the Calendate2DateFieldConversion looks like following :

/*
 * Created on 19 nov. 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package MyPackage;

import java.sql.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;

import org.apache.ojb.broker.accesslayer.conversions.FieldConversion;

/**
 * @author ghd
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class Calendar2DateFieldConversion implements FieldConversion {
/**
 * @see FieldConversion#javaToSql(Object)
 */
public Object javaToSql(Object source)
{
if (source instanceof Calendar)
{
return new Date(((Calendar) source).getTimeInMillis());
}
else
{
return source;
}
}

/**
 * @see FieldConversion#sqlToJava(Object)
 */
public Object sqlToJava(Object source)
{
if (source instanceof Date)
{
GregorianCalendar cal = new GregorianCalendar();
cal.setTimeInMillis(((Date)source).getTime());
return cal;
}
else
{
return source;
}
}
}

my problemn is that the date are stored without the hour informations under
Oracle. It works fine with SQL Server. :-(

Does somebody knows about this problem ?

Regards.

Éric


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



RE: jdbc-connection-descriptor

2004-01-09 Thread eric barbe
Thanks a lot;

I will try thoose scripts !

Bye

Éric

-Message d'origine-
De : Geigl Maximilian, R235 [mailto:[EMAIL PROTECTED]
Envoyé : vendredi 9 janvier 2004 16:30
À : OJB Users List
Objet : AW: jdbc-connection-descriptor


Hi Eric,

you can try the following descriptors. Variables that you must replace by
values that fit your environment are set between %%. I think their names
describe their meanings.

Good luck
Max

DB2:






   


Informix:






   

> -Ursprüngliche Nachricht-
> Von: eric barbe [mailto:[EMAIL PROTECTED]
> Gesendet: Freitag, 9. Januar 2004 16:10
> An: OJB
> Betreff: jdbc-connection-descriptor
>
>
> Hi everybody,
>
> Can anyone send to me some jdbc-connection-descriptor for DB2
> and Informix ?
>
> Thanks a lot.
>
> Éric
>
>
> -
> 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]



jdbc-connection-descriptor

2004-01-09 Thread eric barbe
Hi everybody,

Can anyone send to me some jdbc-connection-descriptor for DB2 and Informix ?

Thanks a lot.

Éric


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



RE: BATCH-MODE parameter

2003-12-10 Thread eric barbe
Hi,

Here is the full stack trace of the exception:

java.lang.IllegalArgumentException: object is not an instance of declaring
class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.doExecut
e(Unknown Source)
at
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(U
nknown Source)
at $Proxy0.doExecute(Unknown Source)
at org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(Unknown
Source)
at org.apache.ojb.broker.util.batch.BatchConnection.nextExecuted(Unknown
Source)
at
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(U
nknown Source)
at $Proxy0.executeUpdate(Unknown Source)
at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)Notif 4240 - act: 4832

at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
at Test.main(Test.java:110)

Eric

-Message d'origine-
De : Oleg Nitz [mailto:[EMAIL PROTECTED]
Envoye : mardi 9 decembre 2003 14:36
A : OJB Users List
Objet : Re: BATCH-MODE parameter


Hi Eric,

Please send the full stack trace of the exception.

Oleg

-Original Message-
From: "eric barbe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Date: Tue, 9 Dec 2003 10:24:31 +0100
Subject: BATCH-MODE parameter

> Hi all,
>
> In order to ameliorate performance, I've tried to set batch-mode parameter
> to true in the repository
> (if this is not intended to ameliorate performance, please tell me).
> Unfortunately, I get an error when executing my program :
>
> "Object is not an instance of declaring class".
>
> Here is the jdbc-connection-descriptor element in my repository:
>
>  default-connection="true"
>   jcd-alias="bod"
>   platform="oracle"
>   jdbc-level="2.0"
>   driver="oracle.jdbc.driver.OracleDriver"
>   protocol="jdbc"
>   subprotocol="oracle:thin"
>   dbalias="@superbug:1521:dbmaster"
>   username="SEJ"
>   password="SEJ"
>   batch-mode="true">
>
>  maxActive="15"
>   whenExhaustedAction="0"
>   testOnBorrow="false"
>   testOnReturn="false"
>   validationQuery="select count(*) from OJB_HL_SEQ"/>
>
>   
className="org.apache.ojb.broker.util.sequence.SequenceManagerInMemoryImpl">
>attribute-value="true"/>
>   
>
>   
>
>
> Here is the code:
>
>   broker.beginTransaction();
>   broker.serviceConnectionManager().setBatchMode(true);
>   broker.store(myobject);
>   broker.commitTransaction();
>
> Note: even if I comment out the second line, it does not work any better.
> Besides, if I set batch-mode to "false", everything is OK.
>
> I use Oracle 8i.
>
> Thanks for your help.
>
> Regards
> Eric BARBи
>
>
> -
> 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]



BATCH-MODE parameter

2003-12-09 Thread eric barbe
Hi all,

In order to ameliorate performance, I've tried to set batch-mode parameter
to true in the repository
(if this is not intended to ameliorate performance, please tell me).
Unfortunately, I get an error when executing my program :

"Object is not an instance of declaring class".

Here is the jdbc-connection-descriptor element in my repository:












Here is the code:

broker.beginTransaction();
broker.serviceConnectionManager().setBatchMode(true);
broker.store(myobject);
broker.commitTransaction();

Note: even if I comment out the second line, it does not work any better.
Besides, if I set batch-mode to "false", everything is OK.

I use Oracle 8i.

Thanks for your help.

Regards
Eric BARBÉ


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



RE: Mapping question

2003-11-28 Thread eric barbe
Hi,

I don't really understand you're pb. ;o(
Is it : any field from my class A can be THE foreign key (mykey in this
case) from my class B ?

Regards

Éric

-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Envoyé : jeudi 27 novembre 2003 17:49
À : [EMAIL PROTECTED]
Objet : RE: Mapping question


Thanks, I defined it like that, but:

>If A is 1 and B is n.
>In A class descriptor write :

>element-class-ref="url.B">
>   
>

>And in B class descriptor write this

>
>Here mykey is the foreignkey but not a primary key !

OJB generates statements where mykey points to the pk of class A. The
generated join looks like: A.pk = B.mykey
We need: A.anyField = B.mykey
In fact I think we've a m:n mapping without intermediary table...
What can we do (the database model cannot be changed)?
Is there a possibility to add to the collection-descriptor something like
 similar to the 
element?

Thanks again.

-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Envoyé : jeudi 27 novembre 2003 16:57
À : [EMAIL PROTECTED]
Objet : Mapping question


Hi,

I've got a 1:n mapping from table A to table B. But the foreign key field of
table A is not it's primary key. I can't find how to tell OJB to use another
field to join table B.
Thanks for help, Norbert.


-
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: Mapping question

2003-11-27 Thread eric barbe
Hi,

If A is 1 and B is n.
In A class descriptor write :





And in B class descriptor write this



Here mykey is the foreignkey but not a primary key !

Hope it helps you,

Éric

-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Envoyé : jeudi 27 novembre 2003 16:57
À : [EMAIL PROTECTED]
Objet : Mapping question


Hi,

I've got a 1:n mapping from table A to table B. But the foreign key field of
table A is not it's primary key. I can't find how to tell OJB to use another
field to join table B.
Thanks for help, Norbert.


-
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: Collection of string

2003-11-25 Thread eric barbe
Hi all,

YES, YES, and YES, I think we need this feature ! ;o)
Why ?
First, if you want to use your database information without OJB, you can not
do simply data reporting or analysis.
Second, if you are coding an API that can be use with a lot of heterogeneous
projects that don't use at least OJB or a database, it is not conceptually
correct to force users to use Wrapper classes.
Example : we are developping an API that allows to handle our kernel datas.
This API is use with a lot of projects and uses the standard java types.
Creating wrapper classes :
- will be diverting the developpers,
- will lost the compatibility,
- will be not consistant with the philosophy of Java, what is an APIString
? A string, a stringbuffer ?
Then you will decide to create a second API, one for the "old users" and one
for the "OJB users" and then it will be to difficult to maintain.

In short, YES, YES, and YES, we need this feature !

Best regards,

Sorry for my english !!

Eric

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Envoye : mardi 25 novembre 2003 18:18
A : OJB Users List
Objet : Re: Collection of string


Hi all,


Thomas Dudziak wrote:
>
> On Tue, 25 Nov 2003, eric barbe wrote:
>
>
>>Hi,
>>
>>Honestly, I did not test Hibernate, I only read the documentation.
>>Hibernate works the other way around from OBJ for modeling the XML.
>>What I saw for string list is this :
>>  
>>  
>>  
>>  
>>It seem's simply. You give the "name" property, then the "table" name and
>>the field (or element here) type.
>>
>>I think that Hibernate is wrapping each java object naturally.
>>
>>Regards
>>
>>Eric
>>
>>PS : see this link
>>http://www.hibernate.org/hib_docs/reference/html/collections.html#collecti
on
>>s-s1-3
>>
>
>
> Unless I'm mistaken this seems to be something that OJB is not capable of,
> at least not directly. In OJB, the elements of collections have to have a
> class descriptor in the repository descriptor whereas Hibernate seems to
> also have the notion of "primitive" elements.

Yes, with OJB you would have to write a simple Wrapper class that is
declared as element-class in the collection-descriptor.

questions to the users: Do we need a feature to simplify the storage of
primitive types?

cu,
Thomas

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




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



RE: Collection of string

2003-11-25 Thread eric barbe
Hi,

Honestly, I did not test Hibernate, I only read the documentation.
Hibernate works the other way around from OBJ for modeling the XML.
What I saw for string list is this :




It seem's simply. You give the "name" property, then the "table" name and
the field (or element here) type.

I think that Hibernate is wrapping each java object naturally.

Regards

Eric

PS : see this link
http://www.hibernate.org/hib_docs/reference/html/collections.html#collection
s-s1-3


-Message d'origine-
De : Thomas Dudziak [mailto:[EMAIL PROTECTED]
Envoye : lundi 24 novembre 2003 20:34
A : OJB Users List
Objet : RE: Collection of string




On Mon, 24 Nov 2003 [EMAIL PROTECTED] wrote:

> Hello Thomas,
>
> > -Original Message-
> > From: Mahler Thomas [mailto:[EMAIL PROTECTED]
>
> > 1. Define your DB coulm as VARCHAR.
> > 2. in the repository_user.xml you set
> > conversion="org.apache.ojb.broker.accesslayer.
> > conversions.StringVector2Varch arFieldConversion"
> > 3. That's all!
> >
> > All strings of your Vector get concatened and written to the
> > VARCHAR column
> > in human readable form.
>
> that is nice only for collections of bounded size of Strings
> of bounded lengths.  Otherwise you get troubles with
> the column length of the database, don't you?
>

Mapping to BLOB/CLOB is certainly better here (using appropriate
conversions), and CLOB might be human readable, but as I understand the
problem, Eric wanted to have each string in a separate row in the
database ?! Can this be handled via a row-reader for class String ?

Eric, can you perhaps give some details on how Hibernate handles this ?

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]



RE: Collection of string

2003-11-24 Thread eric barbe
Yes, you're right, but what do you think about Hibernate witch seems to do
this very simply ?

Eric

-Message d'origine-
De : Thomas Dudziak [mailto:[EMAIL PROTECTED]
Envoye : lundi 24 novembre 2003 11:01
A : OJB Users List
Objet : RE: Collection of string




On Mon, 24 Nov 2003, eric barbe wrote:

> Hi Thomas,
>
> Thanks for your help.
> I thought about this solution, but honestly, it is not very beautiful.
> They are no other ways ?
> Is it possible to hope that OJB will do this easily in a future release ?

Thats not so much a problem of OJB but a design decision of Java. Strings
are immutable after creation (value objects). OJB can work with all
objects that are changeable after creation and have a default constructor.
Actually, that is not quite correct. It seems that in the current CVS
version you can define a factory class and method to create objects so
there is no need for the default constructor anymore. So in theory, you
might be able to use strings after all, using a combination of
factory-class/method and a custom row-reader for the string objects
(I'm not an expert of row-readers so this might be wrong). But this is
probably not quite an elegant solution.

As for the "beauty" of the solution, that depends on your application, or
more precisely, on how the strings are used. If there is functionality
that can be put into the wrapper objects (say, conversion from exceptions,
serialization to/from XML etc.) then they can actually make the design of
your system more beautiful.

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]



RE: Collection of string

2003-11-24 Thread eric barbe
Hi Thomas,

Thanks for your help.
I thought about this solution, but honestly, it is not very beautiful.
They are no other ways ?
Is it possible to hope that OJB will do this easily in a future release ?

Thanks,

Regards

Eric

-Message d'origine-
De : Thomas Dudziak [mailto:[EMAIL PROTECTED]
Envoye : vendredi 21 novembre 2003 18:15
A : OJB Users List
Objet : RE: Collection of string




On Fri, 21 Nov 2003, eric barbe wrote:

> Hi,
>
> Yes, I need to use this table on reporting applications that do not use
OJB.
> This fields must be readable.
>

The string class itself won't work as an existing string object cannot be
changed anymore (upon loading OJB creates the object using the no-argument
constructor and the sets the fields). So I suggest that you use a wrapper
class in your collection such as:

class Value
{
  private Integer id;
  private String  value;

  ...

  public Value()
  {}

  public void setValue(String value)
  {
this.value = value;
  }

  public String getValue()
  {
return value;
  }

  ...
}

(You don't really need the id here, an anonymous primarykey field would
also work).
Then you simply define a class descriptor for this class in
your repository descriptor.

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]



RE: Collection of string

2003-11-21 Thread eric barbe
Hi,

Yes, I need to use this table on reporting applications that do not use OJB.
This fields must be readable.

Eric

-Message d'origine-
De : Thomas Dudziak [mailto:[EMAIL PROTECTED]
Envoye : vendredi 21 novembre 2003 17:39
A : OJB Users List
Objet : Re: Collection of string



~
On Fri, 21 Nov 2003, eric barbe wrote:

> Hi,
>
> I'm trying to map a string list declared as ArrayList in my Java code.
> I declared a collection like this
>
>   
>   ...
>  element-class-ref="java.lang.String" auto-update="true"
auto-retrieve="true"
> auto-delete="false">
>   
> 
>   ...
>   
>
> I try to declare the class java.lang.String, it seems stupid, but i don't
> know how to do :
>
>   
>  primarykey="true" autoincrement="true" access="anonymous"/>
>  access="anonymous"/>
>  jdbc-type="INTEGER" access="anonymous"/>
>   
>
> And my DDL script looks like the following
>   CREATE TABLE strings
>   (
> ida INTEGER PRIMARY KEY
> ,opt_string VARCHAR(255)
> ,propvalues INTEGER
> ,FOREIGN KEY (propvalues) REFERENCES properties(ida)
>   );
>
> Unfortunately nothing is mapped.
> If you understand my problem, can you give me a solution ?

Do you really need a table for the strings ? You could declare a field
(instead of a collection) for the string array using the CLOB, BLOB or
LONGVARBINARY type:



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]



Collection of string

2003-11-21 Thread eric barbe
Hi,

I'm trying to map a string list declared as ArrayList in my Java code.
I declared a collection like this

  
  ...

  

  ...
  

I try to declare the class java.lang.String, it seems stupid, but i don't
know how to do :

  



  

And my DDL script looks like the following
  CREATE TABLE strings
  (
ida INTEGER PRIMARY KEY
,opt_string VARCHAR(255)
,propvalues INTEGER
,FOREIGN KEY (propvalues) REFERENCES properties(ida)
  );

Unfortunately nothing is mapped.
If you understand my problem, can you give me a solution ?

Thanks,

Regards

Éric


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