Re: Borrow broker from pool failed

2003-07-03 Thread Christophe Marcourt
I give you as well my connection configuration :


  
  
 

cheers.

Christophe

- Original Message - 
From: "Christophe Marcourt" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>; "Armin Waibel"
<[EMAIL PROTECTED]>
Sent: Thursday, July 03, 2003 11:20 PM
Subject: Re: Borrow broker from pool failed


> Here you go :
>
> org.apache.ojb.broker.PBFactoryException: Borrow broker from pool failed
> 2003-07-03 22:39:51,125 FATAL [Thread-5] -
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersist
> enceBroker(Unknown Source)
> 2003-07-03 22:39:51,125 FATAL [Thread-5] -
>
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.defaultPersis
> tenceBroker(Unknown Source)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unkn
> own Source)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> com.hbk.admin.form.RoomParameter.doDefault(RoomParameter.java:152)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
com.celeno.mandarino.form.AbstractFormDispatch.process(AbstractFormDispatch.
> java:175)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> com.celeno.mandarino.Controller.handleRequest(Controller.java:117)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> 72)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:333)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> 2003-07-03 22:39:51,126 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:256)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:191)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> .java:494)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,127 FATAL [Thread-5] -
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
> )
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:643)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> java:171)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
> )
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
> eNext(StandardPipeline.java:641)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 2003-07-03 22:39:51,128 FATAL [Thread-5] -
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv

Re: Borrow broker from pool failed

2003-07-03 Thread Christophe Marcourt
:51,129 FATAL [Thread-5] -
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
2003-07-03 22:39:51,129 FATAL [Thread-5] -
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
2003-07-03 22:39:51,129 FATAL [Thread-5] -
java.lang.Thread.run(Thread.java:536)

By the way I do close() my broker every time I use it.

Christophe

- Original Message - 
From: "Armin Waibel" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Thursday, July 03, 2003 11:18 PM
Subject: Re: Borrow broker from pool failed


> Can you post the whole stack trace, please?
>
> regards,
> Armin
>
> - Original Message -
> From: "Christophe Marcourt" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Thursday, July 03, 2003 10:52 PM
> Subject: Borrow broker from pool failed
>
>
> > Hi,
> >
> > after a couple of hours of inactivity I get a "Borrow broker from pool
> > failed" when I request a page on my site where's OJB make a simple
> SELECT
> > query.
> > I'm using MySQL 4 and OJB 1.0 rc3.
> >
> > Any idea ?
> >
> > Christophe
> >
> >
> > ---
> > Ce message Envoi est certifié sans virus connu.
> > Protégé par l'antivirus AVG Deluxe.
> > Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003
> >
> >
> > -
> > 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]
>


---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003


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



Borrow broker from pool failed

2003-07-03 Thread Christophe Marcourt
Hi,

after a couple of hours of inactivity I get a "Borrow broker from pool
failed" when I request a page on my site where's OJB make a simple SELECT
query.
I'm using MySQL 4 and OJB 1.0 rc3.

Any idea ?

Christophe


---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003


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



Re: complex class prolem

2003-06-28 Thread Christophe Marcourt
As it was said to me a few days ago, don't work with Vector but only the
interface Collection or List.
It will work then.

Christophe

- Original Message - 
From: "Timofey Korolev" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Saturday, June 28, 2003 7:39 PM
Subject: complex class prolem


> Hello there!
> I'm new to OJB. I've tried a simple O/R mapping and it worked, but when
> i've tried to map real life objects i got a problem.
>
> There are three classes:
>
> LOMGeneralObject & LOMGeneralLanguage & LangString:
>
> public class LOMGeneralObject {
> private BigDecimal identifier;
> private LangString title;
> private BigDecimal titleId;
> private Vector language;
> .
> }
>
> public class LOMGeneralLanguage {
> BigDecimal id;
> String language;
> LOMGeneralObject  gen_object;
> BigDecimal gid;
> ..
> }
>
>
> public class LangString {
> BigDecimal id;
> String string;
> String language;
> 
> }
>
> there are also some SQL tables (postgres) for them:
>
> TABLE GENERAL:
> IDENTIFIER SERIAL PRIMARY KEY
> TITLE DECIMAL(10,0)
>
> TABLE LANGSTRING:
> ID SERIAL
> LANGUAGE VARCHAR
> STRING VARCHAR
>
> TABLE GENERAL_LANGUAGE:
> ID SERIAL PRIMARY KEY
> LANGUAGE VARCHAR
> GID DECIMAL(10,0)
>
>
> and here goes XML-mapping for them:
>
>   table="GENERAL"  >
>
>  sequence-name="general_identifier_seq" jdbc-type="NUMERIC"
> autoincrement="true" primarykey="true" />
>
>  jdbc-type="NUMERIC"/>
>
>  class-ref="ru.chemnet.lom.LangString" auto-retrieve="true"
> auto-update="true" auto-delete="true"  >
>
> 
>
> 
>
>  element-class-ref="ru.chemnet.lom.LOMGeneralLanguage" orderby="id"
> sort="DESC" >
> 
> 
> 
>
> 
>  autoincrement="true" primarykey="true"
> sequence-name="langstring_id_seq"  />
>  jdbc-type="VARCHAR" />
>  jdbc-type="VARCHAR" />
> 
>
>  table="GENERAL_LANGUAGE">
>  autoincrement="true" primarykey="true"
> sequence-name="general_language_id_seq" />
>  jdbc-type="VARCHAR"/>
> 
>  class-ref="ru.chemnet.lom.LOMGeneralObject" auto-retrieve="true"
> auto-update="true" auto-delete="true">
> 
> 
> 
>
>
> The problem is that I try to make LOMGeneralObject and to store it.
> title field of LOMGeneralObject stores to LANGSTRING table perfectly,
> but
> LOMGeneralObject.title of Vector type doesn't make any records in
> GENERAL_LANGUAGE at all.
>
> I've read Advanced O/R mapping tutorial for hundred times and still
> cannot find out what' wrong.
> May be someone can help me? Thank you.
>
>
>
> -- 
> Regards,
> CEO Linux-Online.Ru
> Korolyov Timofey
>
> www.linuxshop.ru :: www.prefnews.ru :: www.dotstyle.ru
>
> JabberID: [EMAIL PROTECTED]
>


---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003


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



Re: Update only some fields in DB

2003-06-28 Thread Christophe Marcourt
I think it's possible.

Before update your object you need to get it from DB with a
getObjectByQuery() method call, than you can only update the fileds you
need.
See tutorial 1 : Updating Objects.

Christophe

- Original Message - 
From: "Mykola Ostapchuk" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 29, 2003 2:05 AM
Subject: Update only some fields in DB


> Hello,
>
> This question already was in this maillist, but nobody answered.
> It's actually so fundamental in use, that it must be somewhere in FAQ.
>
> So, here it is: How can I update not all, but only some fields in some
> table? I'm using PersistenceBroker.store method to persist an object - and
> if I don't populate all the object properties with values, I get null rows
> in DB in place of unspecified object properties...
> At least, please, answer if it's possible with OJB.
>
>
> Best regards,
> Mykola Ostapchuk
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.492 / Base de données virus: 291 - Date: 24/06/2003


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



Proxy again and again...

2003-06-24 Thread Christophe Marcourt
Are you sure proxy is working ???
I'm working with OJB 1.0 rc3.

I've got all my simple collections. Not arrays, not manageable collections only 
Vectors.
Everytime I turned on the proxy in my repository.xml, always the same Exception :

[org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl] ERROR: while 
set field:
object class[ com.hbk.bean.Neighbourhood
target field: houses
target field type: class java.util.Vector
object value class: org.apache.ojb.broker.accesslayer.ListProxy
object value: [EMAIL PROTECTED]
java.lang.IllegalArgumentException

I don't understand at all.
Can we have a concrete example in the tutorial ?

Christophe


Re: OJB not to cache its queries

2003-06-23 Thread Christophe Marcourt
yes

- Original Message - 
From: "Srikanth Gubba" <[EMAIL PROTECTED]>
To: "'OJB Users List'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, June 23, 2003 9:38 PM
Subject: RE: OJB not to cache its queries


hi christophe,

so, should i use

in my repository.xml?

Thanks,
srikanth.

-Original Message-
From: Christophe Marcourt [mailto:[EMAIL PROTECTED]
Sent: Monday, June 23, 2003 3:07 PM
To: OJB Users List
Subject: Re: OJB not to cache its queries


you can use the refresh attribute set to true in your repository.xml.

Christophe

- Original Message - 
From: "Srikanth Gubba" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 23, 2003 8:29 PM
Subject: OJB not to cache its queries


> Hi all,
>
> do u know how to configure ojb not to cache its queries? any help
> appreciated.
>
> Thanks in adv,
> srikanth
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.488 / Base de données virus: 287 - Date: 05/06/2003


-
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: OJB not to cache its queries

2003-06-23 Thread Christophe Marcourt
you can use the refresh attribute set to true in your repository.xml.

Christophe

- Original Message - 
From: "Srikanth Gubba" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 23, 2003 8:29 PM
Subject: OJB not to cache its queries


> Hi all,
>
> do u know how to configure ojb not to cache its queries? any help
> appreciated.
>
> Thanks in adv,
> srikanth
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.488 / Base de données virus: 287 - Date: 05/06/2003


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



Re: How to map oracle field number(10,5)

2003-06-20 Thread Christophe Marcourt
hi,

it should work with DOUBLE JDBC type and so native double in java.
So you will have :



the length and precision attributes are not required.

Christophe

- Original Message - 
From: "airwing" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 10:39 AM
Subject: How to map oracle field number(10,5)


> How to map number(10,5) field in repository.xml and java file?
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.488 / Base de données virus: 287 - Date: 05/06/2003


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



Re: FieldConversion and Cache

2003-06-19 Thread Christophe Marcourt
I found it.
After a few tries, I search in the object cache implementation and I changed
the ObjectCacheDefaultImpl to ObjectCachePerBrokerImpl and it works.
Now my own FieldConversion fill well my objects and there are always up to
date.

Christophe

- Original Message - 
From: "Christophe Marcourt" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 8:03 PM
Subject: Re: FieldConversion and Cache


> Ok, I agree, but that's not the point.
> I know my database and I know it will only be integer.
>
> - Original Message - 
> From: <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Thursday, June 19, 2003 6:48 PM
> Subject: Re: FieldConversion and Cache
>
>
> > Christophe -- 
> >
> > In your sqlToJava method, you only convert the value if the 'inbound'
> value is an Integer.  Chances are, the 'inbound' value is of another type,
> perhaps BigDecimal.
> >
> > Ron Gallagher
> > Atlanta, GA
> > [EMAIL PROTECTED]
> >
> > >
> > > From: cmarcourt <[EMAIL PROTECTED]>
> > > Date: 2003/06/19 Thu AM 11:29:28 EDT
> > > To: [EMAIL PROTECTED]
> > > Subject: FieldConversion and Cache
> > >
> > > Hello,
> > >
> > > I wrote my own FieldConversion objects which implements
FieldConversion
> interface.
> > > It works well the first time, but as soon as I do an insert or an
update
> the conversion is not working again.
> > >
> > > here is one of my FieldConversion object :
> > >
> > > public class CustomerPrefix2IntegerFieldConversion implements
> org.apache.ojb.broker.accesslayer.conversions.FieldConversion {
> > >
> > > /** Creates a new instance of
CustomerPrefix2IntegerFieldConversion
> */
> > > public CustomerPrefix2IntegerFieldConversion() {
> > > }
> > >
> > > public Object javaToSql(Object obj) throws
> org.apache.ojb.broker.accesslayer.conversions.ConversionException {
> > > Integer id = null;
> > >
> > > if (obj instanceof CustomerPrefix)
> > > id = new Integer(((CustomerPrefix) obj).getId());
> > >
> > > return id;
> > > }
> > >
> > > public Object sqlToJava(Object obj) throws
> org.apache.ojb.broker.accesslayer.conversions.ConversionException {
> > > CustomerPrefix cp = null;
> > >
> > > if (obj instanceof Integer) {
> > > int id = ((Integer) obj).intValue();
> > > boolean found = false;
> > > int i = 0;
> > > Prefixes ps = Constant.hbkConfiguration.getPrefixes();
> > > Prefix p = null;
> > >
> > > while (!found && (i < ps.getPrefixCount())) {
> > > p = ps.getPrefix(i);
> > > if (Integer.parseInt(p.getId())==id)
> > > found = true;
> > > i++;
> > > }
> > >
> > > if (found) {
> > > ArrayList al = new ArrayList();
> > > cp = new CustomerPrefix();
> > > cp.setId(id);
> > >
> > > Value v = null;
> > > Label l = null;
> > >
> > > for (i = 0; i < p.getValueCount(); i++) {
> > > v = p.getValue(i);
> > > l = new Label();
> > > l.setLanguageId(v.getLanguage().toString());
> > > l.setContent(v.getContent());
> > >
> > > al.add(l);
> > > }
> > >
> > > cp.setLabels((Label[]) al.toArray(new
> Label[al.size()]));
> > > }
> > > }
> > >
> > > return cp;
> > > }
> > > }
> > >
> > > where Constant.hbkConfiguration is a small Castor XML tree in static.
> > >
> > > Does the FieldConversion objects are cached ? If yes can we disabled
> this in the ojb properties ?
> > >
> > > NB :
> > > By the way, OJB is a great tool. (looks familiar to me because I work
> with TopLink).
> > > It's a great saving of time !
> > >
> > > Christophe
> > >
> > > -
> > > 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]
> >
>
>
> ---
> Ce message Envoi est certifié sans virus connu.
> Protégé par l'antivirus AVG Deluxe.
> Version: 6.0.488 / Base de données virus: 287 - Date: 05/06/2003
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.488 / Base de données virus: 287 - Date: 05/06/2003


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



Re: FieldConversion and Cache

2003-06-19 Thread Christophe Marcourt
Ok, I agree, but that's not the point.
I know my database and I know it will only be integer.

- Original Message - 
From: <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 6:48 PM
Subject: Re: FieldConversion and Cache


> Christophe -- 
>
> In your sqlToJava method, you only convert the value if the 'inbound'
value is an Integer.  Chances are, the 'inbound' value is of another type,
perhaps BigDecimal.
>
> Ron Gallagher
> Atlanta, GA
> [EMAIL PROTECTED]
>
> >
> > From: cmarcourt <[EMAIL PROTECTED]>
> > Date: 2003/06/19 Thu AM 11:29:28 EDT
> > To: [EMAIL PROTECTED]
> > Subject: FieldConversion and Cache
> >
> > Hello,
> >
> > I wrote my own FieldConversion objects which implements FieldConversion
interface.
> > It works well the first time, but as soon as I do an insert or an update
the conversion is not working again.
> >
> > here is one of my FieldConversion object :
> >
> > public class CustomerPrefix2IntegerFieldConversion implements
org.apache.ojb.broker.accesslayer.conversions.FieldConversion {
> >
> > /** Creates a new instance of CustomerPrefix2IntegerFieldConversion
*/
> > public CustomerPrefix2IntegerFieldConversion() {
> > }
> >
> > public Object javaToSql(Object obj) throws
org.apache.ojb.broker.accesslayer.conversions.ConversionException {
> > Integer id = null;
> >
> > if (obj instanceof CustomerPrefix)
> > id = new Integer(((CustomerPrefix) obj).getId());
> >
> > return id;
> > }
> >
> > public Object sqlToJava(Object obj) throws
org.apache.ojb.broker.accesslayer.conversions.ConversionException {
> > CustomerPrefix cp = null;
> >
> > if (obj instanceof Integer) {
> > int id = ((Integer) obj).intValue();
> > boolean found = false;
> > int i = 0;
> > Prefixes ps = Constant.hbkConfiguration.getPrefixes();
> > Prefix p = null;
> >
> > while (!found && (i < ps.getPrefixCount())) {
> > p = ps.getPrefix(i);
> > if (Integer.parseInt(p.getId())==id)
> > found = true;
> > i++;
> > }
> >
> > if (found) {
> > ArrayList al = new ArrayList();
> > cp = new CustomerPrefix();
> > cp.setId(id);
> >
> > Value v = null;
> > Label l = null;
> >
> > for (i = 0; i < p.getValueCount(); i++) {
> > v = p.getValue(i);
> > l = new Label();
> > l.setLanguageId(v.getLanguage().toString());
> > l.setContent(v.getContent());
> >
> > al.add(l);
> > }
> >
> > cp.setLabels((Label[]) al.toArray(new
Label[al.size()]));
> > }
> > }
> >
> > return cp;
> > }
> > }
> >
> > where Constant.hbkConfiguration is a small Castor XML tree in static.
> >
> > Does the FieldConversion objects are cached ? If yes can we disabled
this in the ojb properties ?
> >
> > NB :
> > By the way, OJB is a great tool. (looks familiar to me because I work
with TopLink).
> > It's a great saving of time !
> >
> > Christophe
> >
> > -
> > 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]
>


---
Ce message Envoi est certifié sans virus connu.
Protégé par l'antivirus AVG Deluxe.
Version: 6.0.488 / Base de données virus: 287 - Date: 05/06/2003


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