Re: Problem with char mapping
Armin Thnak you for your elements. But what is the good solutions when I want to use char size 1 (as substitute of Boolean) and Long ? Andre Le Mercredi 21 Janvier 2004 18:12, Armin Waibel a écrit : > Hi again, > > A Leg wrote: > > Armin > > > > I use db-ojb-1.0.rc4. > > ok, in final 1.0 BOOLEAN datatype should be supported (but there is > currently no test case for that, so no guarantee ;-)) > > > And it seem that the problem is similar for numeric where ojb accept > > only BigDecimal : > > > > [PersistentField] ERROR: while set field: > > object class[ org.compiere.mfg_scm.dbManager.MGT_Request > > target field: jobNum > > target field type: class java.lang.Long > > object value class: java.math.BigDecimal > > object value: 1] > > null > > > > I made the test with Long and with int, problem is the same if in > > database the column is Numeric. > > yep, OJB does the mapping as specified by sun and NUMERIC is mapped to > BigDecimal. > > regards, > Armin > > > Andre > > > > Armin Waibel wrote: > >> Hi Andre, > >> > >> A Leg wrote: > >>> Hi every body > >>> > >>> I have a variable name hold declare as char in code. (It was first a > >>> Boolean but I change as Boolean is not supported) > >> > >> Which version of OJB do you use? > >> > >>> mapping is : > >>> > >>> and in postgres the column is bpchar (size 1) > >>> > >>> I get the following errors (see belo). I have to declare it as String > >>> in my java code to get it work. But I would like to declare it as char. > >>> Does any body able to explain that and to give a solution ? > >> > >> Think you need a field-conversion, because sun's mapping convention > >> say that CHAR was mapped to String > >> See > >> http://db.apache.org/ojb/jdbc-types.html > >> > >> Write your own String2CharFieldConversion. You can find many examples > >> in source code (..broker.accesslayer.conversion package) > >> > >> regards, > >> Armin > >> > >>> Best regards > >>> > >>> Andre Legendre > >>> > >>> [PersistentField] ERROR: while set field: > >>> object class[ org.compiere.mfg_scm.dbManager.MGB_Request > >>> target field: hold > >>> target field type: char > >>> object value class: java.lang.String > >>> object value: N] > >>> null > >>> java.lang.IllegalArgumentException > >>> at > >>> sun.reflect.UnsafeCharacterFieldAccessorImpl.set(UnsafeCharacterFieldAc > >>>cessorImpl.java:68) > >>> > >>> at java.lang.reflect.Field.set(Field.java:519) > >>> at > >>> org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessI > >>>mpl.doSet(Unknown Source) > >>> at > >>> org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField.set( > >>>Unknown Source) > >>> at > >>> org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.buildWithReflect > >>>ion(Unknown Source) > >>> at > >>> org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readObjectFrom(U > >>>nknown Source) > >>> at > >>> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.materializeObject(Unkn > >>>own Source) > >>> at > >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown > >>> Source) > >>> at > >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Un > >>>known Source) > >>> at > >>> org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unkno > >>>wn Source) > >>> at > >>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery > >>>(Unknown Source) > >>> at > >>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery > >>>(Unknown Source) > >>> at org.compiere.mfg_scm.dbManager.TaskConsumer.showJob(Unknown Source) > >>> at org.compiere.mfg_scm.dbManager.DbManagerImpl.showJob(Unknown Source) > >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > >>> at > >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja > >>>va:39) > >>> > >>> at > >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso > >>>rImpl.java:25) > >>> > >>> at java.lang.reflect.Method.invoke(Method.java:324) > >>> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261) > >>> at sun.rmi.transport.Transport$1.run(Transport.java:148) > >>> at java.security.AccessController.doPrivileged(Native Method) > >>> at sun.rmi.transport.Transport.serviceCall(Transport.java:144) > >>> at > >>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460 > >>>) at > >>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.j > >>>ava:701) > >>> > >>> at java.lang.Thread.run(Thread.java:534) > >>> [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: > >>> PersistenceBrokerException during the execution of materializeObject: > >>> Error setting field:hold in > >>> object:org.compiere.mfg_scm.dbManager.MGB_Request > >>> Error setting field:hold in > >>> object:org.compiere.mfg_scm.dbManager.MGB_Request > >>> java.lang.IllegalArgumentException > >>> at > >>> sun.reflect.UnsafeCharacterFieldAccessorImpl.set(UnsafeCharacterFieldAc > >>>cessorImpl.java:68) > >>> > >>> at j
Re: Any body can help me?
Tim Thanks I will look on that side. Andre Le Mercredi 12 Novembre 2003 13:06, Cobble, Tim a écrit : > I had my database descriptor wrong once in repository_database.xml and > got that error. Maybe check there. I was using a JBoss Datasource for > XXX and had OJB configured for YYY. > > HTH > > Tim > > -Original Message- > From: A Leg [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 11, 2003 4:20 PM > To: OJB Users List > Subject: Re: Any body can help me? > > Hi Antonio > > No it has no "caused by" nor "nest exception". > > The rest of error was some list of application calling tree. > > I am creating som JINI service accessing the persistence layer. > The way JINI services access class is particular, it use a class loader. > > I had first many errors, because it did'nt find the class. > And with these errors I had a "caused by" message. > > With the help of these messages I progress untill now : no more caused > by. > And the class maks as unknown is in the classpath. (in fact in the jar > of the appli). > > Thank's for your help. > > It is late here in cyprus now. We will see tomorrow. > > Andre > > Antonio Gallardo wrote: > >Can you send the full stack trace? > > > >Maybe you miss a "caused by" or a "nested exception". > > > >Best Regards, > > > >Antonio Gallardo > > > >- > >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]