openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Himadri <hima_...@yahoo.co.in>
Subject RE: Issue with ID column for Database view as Entity (EJB3.0)
Date Thu, 01 Jul 2010 06:09:27 GMT

Yeah I have checked that ..Its varchar2 in oracle database but somehow
openjpa interpret it as BIGINT .

tried with columnDefination but same result.  Basically I want id of one of
the table used in view. So finally I changed column name from id to
PropertyID. But now its a new exception 

 org.apache.openjpa.lib.jdbc.ReportingSQLException: [BEA][Oracle JDBC
Driver][Oracle]ORA-00904: "T0"."ID": invalid identifier
 {prepstmnt 4839 SELECT t0.id, t0.BOOLEANVALUE_F,
t0.DEFAULTPROPERTYVALUE_REF, t0.DOUBLEVALUE_F, t0.INTVALUE_F,
t0.MAXIMUMPROPERTYVALUE_REF, t0.MINIMUMPROPERTYVALUE_REF, t0.NAME_F,
t0.OBJECTID_F, t0.OBJECTTYPE_F, t0.PropertyID, t0.STRINGVALUE_F,
t0.TIMEVALUE_F FROM Property_V t0 WHERE (t0.NAME_F = ?) [params=(String)
USERNAME]} [code=904, state=42S22]
	at
org.apache.openjpa.util.Exceptions.replaceNestedThrowables(Exceptions.java:249)
	at
org.apache.openjpa.persistence.PersistenceException.writeObject(PersistenceException.java:100)
	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:597)


Entity looks like this now 

@Column(name="PropertyID" , columnDefinition="VARCHAR2(64)"
,nullable=false,length=64 )
	public String propertyID ;
	public String getPropertyID() {
		return this.propertyID;
	}

& DB view is 

CREATE OR REPLACE FORCE VIEW "XYZ"."PROPERTY_V" ("NAME_F", "VALUETYPE_F",
"MINIMUMPROPERTYVALUE_REF", "DEFAULTPROPERTYVALUE_REF",
"MAXIMUMPROPERTYVALUE_REF", "OBJECTID_F", "OBJECTTYPE_F", "STRINGVALUE_F",
"BOOLEANVALUE_F", "TIMEVALUE_F", "DOUBLEVALUE_F", "INTVALUE_F",
"PROPERTYID") AS 
  SELECT 
    PROPERTY_T.NAME_F NAME_F, 
    PROPERTY_T.VALUETYPE_F VALUETYPE_F, 
    PROPERTY_T.MINIMUMPROPERTYVALUE_REF MINIMUMPROPERTYVALUE_REF, 
    PROPERTY_T.DEFAULTPROPERTYVALUE_REF DEFAULTPROPERTYVALUE_REF, 
    PROPERTY_T.MAXIMUMPROPERTYVALUE_REF MAXIMUMPROPERTYVALUE_REF, 
    PROPERTYVALUE_T.OBJECTID_F OBJECTID_F, 
    PROPERTYVALUE_T.OBJECTTYPE_F OBJECTTYPE_F, 
    PROPERTYVALUE_T.STRINGVALUE_F STRINGVALUE_F, 
    PROPERTYVALUE_T.BOOLEANVALUE_F BOOLEANVALUE_F, 
    PROPERTYVALUE_T.TIMEVALUE_F TIMEVALUE_F, 
    PROPERTYVALUE_T.DOUBLEVALUE_F DOUBLEVALUE_F, 
    PROPERTYVALUE_T.INTVALUE_F INTVALUE_F, 
    PROPERTY_T.ID PropertyID 
FROM 
    PROPERTY_T, 
    PROPERTYVALUE_T 
WHERE 
    PROPERTYVALUE_T.PROPERTY_REF = PROPERTY_T.ID;
 
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Issue-with-ID-column-for-Database-view-as-Entity-EJB3-0-tp5237213p5242161.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message