Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

unable to execute pipeline query using toplink jpa

434201Feb 10 2010 — edited Feb 10 2010
Hi ,
we are evaluating toplink for our on going project wher we are using oracle 10g db , where we use hetregenous services for that , so it is important to use oracle function / procedure in middle layer services .

Now , we have declared a entity class as below , where we did not describe any table name for that :

@Entity
public class RmwData implements Serializable {
//******** Column Definition
@Id
@Column(name = "MRCH_NO")
private String mrchNo ;
@Column(name="LGL_NM")
private String lglNm ;
@Column(name="DBA_NM")
private String dbaNm ;
@Column(name="BIL_TO_ADDR1")
private String billToAddr1 ;
@Column(name="BIL_TO_CITY")
private String billToCity ;
@Column(name="BIL_TO_ST")
private String billToSt ;
@Column(name="BIL_TO_ZIP")
private String billToZip ;
@Column(name="BIL_TO_PHN")
private String billToPhn ;
@Column(name="FRST_NM")
private String frstNm ;
@Column(name="MID_NM")
private String midNm ;
@Column(name="LST_NM")
private String lstNm ;
@Column(name="TIN")
private String tin ;
....
....
....

We are trying to populate the entity class with a pipelined query as below :
RmwData mrch = null;
EntityTransaction tx = em.getTransaction();

tx.begin();
Query q = em.createNativeQuery("select MRCH_NO, LGL_NM , DBA_NM , BIL_TO_ADDR1 , BIL_TO_CITY , BIL_TO_ST , BIL_TO_ZIP , BIL_TO_PHN , FRST_NM , MID_NM , LST_NM , TIN from table(Pkg_Sc1_146a.Func_Fetch_Rmw_Mrch_Pipe(#m))" );
q.setParameter("m", new Long(mrchNo));
List <RmwData> mrchs = q.getResultList();
System.out.println("Size " +mrchs.size());
for (RmwData m1: mrchs) {
mrch = m1;
}



And receiving an exception as below :
Exception in thread "main" java.lang.ClassCastException: java.util.Vector
at rmw.gnf.bean.BeanRmwGnfData.getRmwMrchdata(BeanRmwGnfData.java:76)
at rmw.gnf.bean.BeanRmwGnfData.getData(BeanRmwGnfData.java:33)
at rmw.gnf.bean.BeanRmwGnfData.main(BeanRmwGnfData.java:87)


1. Any dea / help how to retrieve / populate entity bean using pipelined query ?

2. Is there any way to populate entity bean using a refcursor ?

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 10 2010
Added on Feb 10 2010
2 comments
2,807 views