PREFEREDABBREVIATIONNAMEID is column name in DB
PREFEREDABBEREVIATIONNAMEID is the name OJB use. So I think
you have an typo in the metadata mapping file (repository_xxx.xml) for requested class and the declared column name does not match.
regards, Armin
[EMAIL PROTECTED] wrote:
I'm sure this query has come up recently and that it has a simple answer,but I did not save the message and I can't find it in the archive.
I am doing some basic tests on PB just to ensure that I understand how things work. The environment is rc5 with Oracle9i.
Here is the output: EntityPreferedName count (<5): 4 [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException during the execution of the query (for a com.gsk.bet.EntityPreferedName): ORA-00904: "A0"."PREFEREDABBEREVIATIONNAMEID": invalid identifier
ORA-00904: "A0"."PREFEREDABBEREVIATIONNAMEID": invalid identifier
java.sql.SQLException: ORA-00904: "A0"."PREFEREDABBEREVIATIONNAMEID": invalid identifier
Here is the code: [broker = PersistenceBrokerFactory.defaultPersistenceBroker();] // done in setUp()
Criteria c = new Criteria(); c.addLessThan("BETID", new Integer(5)); Query q = new QueryByCriteria(com.gsk.bet.EntityPreferedName.class, c); int count = broker.getCount(q); System.out.println("EntityPreferedName count (<5): " +String.valueOf(count)); Collection results = broker.getCollectionByQuery(q); <----- This line crashes
So the basic query is clearly acceptable to Oracle, but something is generated wrongly when I try to actually retrieve the data. The tables looks like
SQL> desc entitypreferedname Name Null? Type ----------------------------------------- -------- ---------------------------- BETID NUMBER(10) PREFEREDNAMEID NUMBER(10) PREFEREDABBREVIATIONNAMEID NUMBER(10) ENTRYDATE DATE PERSON VARCHAR2(100)
SQL>
... and for the benefit of those who worry about such things, 'preferred' really is mis-spelled in the DB.
--------------------------------------------------------------------- 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]
