JPA/TopLink

Hi Everyone,
I am using JPA with vendor implementation toplink.
For some complex queries like
START WITH EMPLOYEE_ID = 100 CONNECT BY PRIOR EMPLOYEE_ID = MANAGER_ID ORDER SIBLINGS BY LAST_NAME, I am plannign to use TOplink api like ReadAllQuery and ExpressionBuilder.
As per my understanding, We are using JPA to have Vendor independent api and implementaion will be provided in persistence.xml.
If i use some toplink api's ,Tomorrow If i want to change the vendor from Toplink to hibernate. I need to change Toplink code to hibernate in my services.
Is there anyway i can use JPA alone to get all the work done... Thanks in advance for all your suggestions.

JPQL does not support connect by. If you need to use connect by, you must either use vendor specific functionality, or a native SQL query.
James : http://www.eclipse.org/eclipselink/

Similar Messages

  • How to handle journal table using JPA+TopLink

    Hi,
    I am using JDev10.1.3.3 with Swing and EJB + JPA + TopLink using Oracle database. Every business table has a journal table. Does TopLink have any journal features or do I have to write my own code to insert data into the journal table.
    Thanks,
    Jim

    Depends what's in your journal table? TopLink does have support for historization (see HistoryPolicy or docs).
    Otherwise you could use TopLink events to insert into the table, or use database triggers.
    -- James : http://www.eclipselink.org

  • JPA Toplink OneToMany - ManyToOne Relation will not stored in DB

    Hi
    I am getting the error while inserting the data into Two tables by using the ManyToOne realation.
    i am using 2 tables. In parent table i am giving
    @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER,mappedBy="meterInfo")
    @JoinColumn(name="METERID")
    private List<MeterSub> meterSubs=null;
    subtable i am giving
    @ManyToOne(optional=false,targetEntity=com.nexant.mdm.dto.MeterInfoDTO.class)
    @JoinColumn(name="METERID",nullable=false, insertable=false, updatable=false)
    private MeterInfoDTO meterInfo;
    i am inserting the data by using the test class like this:
    MeterInfoDTO mi = new MeterInfoDTO();
    mi.setMeterID(4);
    MeterSub ms = new MeterSub();
    ms.setMeterInfo(mi);
    ms.setMeterData("meterData12");
    ms.setMeterSubPk("103");
    //ms.setMeterID(2);
    List<MeterSub> set = new ArrayList<MeterSub>();
    set.add(ms);
    mi.setMeterSubs(set);
    mi.setMeterName("Sample Meter NAme");
    mi.setMeterTimeZone("TZ");
    Last i am saving the data.
    while inserting the data its giving the following error:
    ORA-02291: integrity constraint (SYSTEM.SYS_C0010451) violated - parent key not found
    Error Code: 2291
    Call: INSERT INTO METERSUB (METERSUBPK, METERDATA, METERID) VALUES (?, ?, ?)
    means its not taking METERID from parent and its giving 0. thats why the error coming like this.
    Can any please help me to resolve this
    Thanks
    Shannu

    Hi Tolls,
    i have one doubt while using the JPA Toplink.
    In my table it have primary key with 2 columns menas composite key acting as a primary key.
    So how i have to declare these fields in POJO class
    and also how to represent these Class and primary key in ONe to One realtion or Many to one relation.
    @ManyToOne(optional=true,targetEntity=com.nexant.mdm.dal.eo.Capability.class)
    @JoinColumn(name="CapabilityID",nullable=false, insertable=true, updatable=false)
    private Capability capability;
    here Capabity is the POjo calss and CapabilityID is the primary key , if in place of CapabilityID i have 2 keys acting as a primary key.
    So how can i represent this?
    waiting for ur valuble response :)

  • JPA/Toplink Tutorials

    Hi ,
    iam looking for advanced JPA/Toplink Documentation (Books) , can any one help me on that ,
    Thanks
    Best Regards,

    TopLink documentation is here: http://www.oracle.com/technology/products/ias/toplink/doc/index.html, including the Developer's Guide.
    JPA resources are listed here: http://www.oracle.com/technology/products/ias/toplink/jpa/resources-index.html

  • Error in JPA Toplink

    Hi,
    I'm using JPA (toplink implementation). When I'm running following named query
    *@NamedQuery(name = "Class.search",*
    query =  "select c "
    + "from Clazz c, Subject sub, School sch "
    + "where sub = c.subject"
    + " and lower(c.name) like :name"
    + " and lower(sub.name) like :subject"
    + " and lower(sch.name) like :school"
    + " and sch = c.school "
    + "order by c.name"
    inside the 11g container, an sqlexception happens. In the exception I can see that the query is translated into following
    SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
         bind => [%, %, %]
    As you can see, the prefix on the class table is class in the select part while it is t0 in the rest of the sql.
    If I run this query in my test outside the container (j2se), then it works fine. I'm using preview 4.
    What is the problem.
    BR
    Jakup

    Hi,
    Here is the exception (I have to cut the last part because it is exceding the maximum length):
    2008-10-06 11:28:48 com.evermind.server.ejb.logging.EJBMessages logException
    SEVERE: [TeachingService:public java.util.List fo.samteld.vitanet.services.TeachingServiceBean.searchClasses(java.lang.String,java.lang.String,java.lang.String)] exception occurred during method invocation: javax.ejb.EJBException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
    Error Code: 904
    Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
         bind => [%, %, %]
    Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz); nested exception is: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
    Error Code: 904
    Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
         bind => [%, %, %]
    Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
    javax.ejb.EJBException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
    Error Code: 904
    Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
         bind => [%, %, %]
    Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz); nested exception is: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
    Error Code: 904
    Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
         bind => [%, %, %]
    Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
    Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
    Error Code: 904
    Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
         bind => [%, %, %]
    Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
         at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:304)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:613)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:467)
         at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:447)
         at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:117)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:250)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:583)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2480)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2438)
         at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:467)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:874)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:671)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:835)
         at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:445)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:899)
         at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2697)
         at oracle.toplink.tools.profiler.DMSPerformanceProfiler.profileExecutionOfQuery(DMSPerformanceProfiler.java:693)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1072)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1058)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1032)
         at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:377)
         at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:488)
         at fo.samteld.vitanet.services.TeachingServiceBean.searchClasses(TeachingServiceBean.java:112)
         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:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:27)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:52)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:182)
         at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:511)
         at oracle.oc4j.security.JaasModeImpl$DoAsPrivilegedExecutor.execute(JaasModeImpl.java:301)
         at oracle.oc4j.security.JaasModeImpl$BasicExecutor.execute(JaasModeImpl.java:161)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:57)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:58)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:104)
         at TeachingService_LocalProxy_5ndopdi.searchClasses(Unknown Source)
         at fo.samteld.vitanet.ui.backing.teaching.ClassSearchBean$CriteriaPane.search(ClassSearchBean.java:95)
         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:585)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1213)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:62)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:174)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:66)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:62)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:174)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:66)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:153)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$GrabEvents.broadcastEvents(LifecycleImpl.java:1109)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:283)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:178)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.adfinternal.view.faces.webapp.rich.SharedLibraryFilter.doFilter(SharedLibraryFilter.java:135)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:69)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
         at oracle.adfinternal.view.faces.activedata.ADSFilter.doFilter(ADSFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:241)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:198)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:141)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:583)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:334)
         at com.evermind.server.http.HttpRequestHandler.doDispatchRequest(HttpRequestHandler.java:942)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:843)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:658)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:626)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:417)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:163)
         at oracle.oc4j.network.ServerSocketReadHandler$ClientRunnable.run(ServerSocketReadHandler.java:275)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:237)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:29)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:877)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:77)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:111)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:472)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:422)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1089)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:204)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:945)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1303)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3556)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3608)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1341)
         at oracle_jdbc_driver_OraclePreparedStatementWrapper_Proxy.executeQuery(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:813)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:539)
         ... 99 more
    javax.ejb.EJBException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
    Error Code: 904
    Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
         bind => [%, %, %]
    Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz); nested exception is: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
    Error Code: 904
    Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
         bind => [%, %, %]
    Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
         at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:96)
         at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:93)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:52)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:182)
         at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:511)
         at oracle.oc4j.security.JaasModeImpl$DoAsPrivilegedExecutor.execute(JaasModeImpl.java:301)
         at oracle.oc4j.security.JaasModeImpl$BasicExecutor.execute(JaasModeImpl.java:161)
         at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:57)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:58)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:104)
         at TeachingService_LocalProxy_5ndopdi.searchClasses(Unknown Source)
         at fo.samteld.vitanet.ui.backing.teaching.ClassSearchBean$CriteriaPane.search(ClassSearchBean.java:95)
         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:585)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1213)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:62)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:174)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:66)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:62)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:174)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:66)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:153)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$GrabEvents.broadcastEvents(LifecycleImpl.java:1109)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:283)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:178)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.adfinternal.view.faces.webapp.rich.SharedLibraryFilter.doFilter(SharedLibraryFilter.java:135)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:69)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
         at oracle.adfinternal.view.faces.activedata.ADSFilter.doFilter(ADSFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:241)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:198)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:141)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:583)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:334)
         at com.evermind.server.http.HttpRequestHandler.doDispatchRequest(HttpRequestHandler.java:942)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:843)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:658)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:626)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:417)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:163)
         at oracle.oc4j.network.ServerSocketReadHandler$ClientRunnable.run(ServerSocketReadHandler.java:275)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:237)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:29)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:877)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
    Error Code: 904
    Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
         bind => [%, %, %]
    Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
         at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:304)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:613)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:467)
         at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:447)
         at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:117)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:250)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:583)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2480)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2438)
         at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:467)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:874)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:671)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:835)
         at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:445)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:899)
         at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2697)
         at oracle.toplink.tools.profiler.DMSPerformanceProfiler.profileExecutionOfQuery(DMSPerformanceProfiler.java:693)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1072)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1058)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1032)
         at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:377)
         at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:488)
         at fo.samteld.vitanet.services.TeachingServiceBean.searchClasses(TeachingServiceBean.java:112)
         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:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:27)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         ... 65 more
    Caused by: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:77)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:111)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:472)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:422)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1089)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:204)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)
         at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:945)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1303)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3556)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3608)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1341)
         at oracle_jdbc_driver_OraclePreparedStatementWrapper_Proxy.executeQuery(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:813)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:539)
         ... 99 more
    BR
    Jakup

  • Unable to deploy Web App using JPA TopLink Essentials in Tomcat5.5.17

    Hi All,
    I am trying to deploy a Web App ( used Top Link Essentials ) to Tomcat and i am getting the following Error..
    I am strating tomcat using -javaagent:/Path/To/spring-agaent.jar
    Dec 14, 2006 9:52:46 AM org.apache.catalina.loader.WebappClassLoader loadClass
    INFO: Illegal access: this web application instance has been stopped already.  Could not load oracle.toplink.essentials.internal.weaving.ClassDetails.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
    java.lang.IllegalStateException
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1238)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            at oracle.toplink.essentials.internal.weaving.TopLinkWeaver.transform(TopLinkWeaver.java:84)
            at org.springframework.orm.jpa.persistenceunit.ClassFileTransformerAdapter.transform(ClassFileTransformerAdapter.java:56)
            at sun.instrument.TransformerManager.transform(TransformerManager.java:122)
            at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
            at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1812)
            at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:866)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            at java.lang.Class.getDeclaredConstructors0(Native Method)
            at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
            at java.lang.Class.getConstructor0(Class.java:2671)
            at java.lang.Class.newInstance0(Class.java:321)
            at java.lang.Class.newInstance(Class.java:303)
            at org.apache.myfaces.application.ApplicationImpl.createComponent(ApplicationImpl.java:396)
            at com.sun.faces.config.ConfigureListener.verifyObjects(ConfigureListener.java:1438)
            at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:509)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
            at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)
            at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)
            at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
            at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
            at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
            at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
            at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
            at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
            at org.apache.catalina.core.StandardService.start(StandardService.java:450)
            at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
            at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
            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:585)
            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432) Thanks
    Sateesh

    Spring 2.0 provides custom support for TopLink Essentials in Tomcat out-of-the-box. You should follow the instructions here: http://static.springframework.org/spring/docs/2.0.x/reference/orm.html#orm-jpa-setup-lcemfb-tomcat
    Essentially, Spring provides a custom class loader for Tomcat and doesn't use an agent.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • JPA Toplink, class cast exception when casting class A to class A

    I get a really strange exception from Toplink JPA. I used netbeans to create a persistence.xml and I generated a class (entity) from the table in a DB. Everything works fine, when I create a select query, I get the list of objects and the list is correctly typed. I can the objects in the list in debug mode with every field correctly set. But then I need to start working with the list, so I iterate through the list. And then I get ClassCastException from class A to class A (when A is the canonical name of the entity class).
    I was working with JPA for some time but never seen that. I am using glassfish v2, mysql, netbeans 6.1. I could post the classes and persistence xml, but persistence.xml is really simple (no class definitions) and the class is annotated by netbeans. Every field is annotated like this:
    @Column(name = "name", nullable = false)
    And Date columns have
    @Temporal(TemporalType.TIMESTAMP)
    The whole class is annotated with @Table.
    Does anyone has any idea, what can be wrong?

    DrClap wrote:
    Make sure your URLClassLoader cannot load the IAdapter class.
    That is not exactly correct. He needs to make sure his URLClassloader has access to the IAdapter class. Sure, it should not load it on its own, but if requested the URLClassloader should be able to ask a parent to load IAdapter. Which in the end looks the same. But is not the same.
    So set the parent classloader of your URLClassloader to a classloader capable of loading IAdapter.

  • JPA/Toplink changes the query logic

    Hi,
    Iam currently using JPA with Toplink implementation , i guess that toplink has its own way of optimizing the provided JPA query ; on another words , toplink sometimes changes the way you are using joins and exists statement to what looks optimized , but unfor. this caused me troubles tracking a query that should work on a certain way but its not cause the generated query by Toplink ( can be captured on the log ) does not represent the same logic , is this a known issue or do i have to write my JPA query on a way on which can be translated correctly by toplink , i know i should provide the query it self , but the model structure is too complex.
    Thanks in advance

    Hello,
    JPQL does not directly translate to SQL, so there might be some differences in what you may be expecting due to JPA requirements on the results that are returned. If there is a problem with specific queries, please let us know and file a bug if it is not behaving the way it should. A workaround would be to use a native SQL query directly.
    Best Regards,
    Chris

  • Query - Hibernate to JPA/TopLink Conversion

    Hi,
    I have some problems with a query. My query works fine in Hibernate but I have to work with TopLink.
    I have created the query below.
    int Language = 1;
    String hql = "SELECT DISTINCT g "
    +    "FROM GUI g "
    +    "JOIN FETCH g.gUINameAllocation gna "
    +    "JOIN FETCH g.elementAllocation gea "
    +    "JOIN FETCH gea.elementTextAllocation geta "
    +    "WHERE g.gUIID = " + java.lang.Integer.toString(GUI) + " "
    +    "AND gna.languageAllocation.languageID = " + java.lang.Integer.toString(Language)
    +    "AND geta.languageAllocation.languageID = " + java.lang.Integer.toString(Language);
    Query query = session.createQuery(hql);
    java.util.List<GUI> results = (java.util.List<GUI>)query.list();
    I have tried to translate the query to JPQL but it does not allow alias names for fetch joins. I have tried to translate it to the Criteria API classes but I will not work. I have tried the Criteria API with the join class and the fetch class.
    I can not use the fetch class in crit.where(...) expression. I can only use there the join classes as far as I understood.
    int Language = 1;
    CriteriaBuilder cb = em.getCriteriaBuilder();
    CriteriaQuery<GUI> crit = cb.createQuery(GUI.class);
    crit.distinct(true);
    Root<GUI> c = crit.from(GUI.class);
    Join<GUI, GUIName> guiname = c.join("gUINameAllocation", JoinType.LEFT);
    Join<GUIName, Language> language = guiname.join("languageAllocation");
    Join<GUI, Element> guielement = c.join("elementAllocation", JoinType.LEFT);
    Join<Element, ElementText> guielementtext = guielement.join("elementTextAllocation", JoinType.LEFT);
    Join<ElementText, Language> language1 = guielementtext.join("languageAllocation");
    crit.where(cb.equal(language.get("languageID"), Language));
    crit.where(cb.equal(language1.get("languageID"), Language));
    Has somebody an idea for a solution?
    Thx in advance

    JPA does not allow alias names on fetch joins, I suspect partially because they could then be used in the filtering in the query - which is exactly what you are doing. This could cause potential caching issues, as the entity that is built might end up missing references that don't conform to the conditions in the where clause, as discussed here:
    http://www.coderanch.com/t/486454/ORM/databases/Join-Fetch-EclipseLink
    According to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=293775 this has been changed and is supported in EclipseLink 2.4 to some degree.
    If you cannot use EclipseLink 2.4 or later, the way to do this in JPQL is to use a separate join for the alias to be used in the query, and one for the fetch join.
    "SELECT DISTINCT g FROM GUI g "
    + "JOIN FETCH g.gUINameAllocation "
    + "JOIN FETCH g.elementAllocation "
    + "JOIN g.gUINameAllocation gna "
    + "JOIN g.elementAllocation gea "
    + "JOIN gea.elementTextAllocation geta "
    + "WHERE g.gUIID = " + java.lang.Integer.toString(GUI) + " "
    + "AND gna.languageAllocation.languageID = " + java.lang.Integer.toString(Language)
    + "AND geta.languageAllocation.languageID = " + java.lang.Integer.toString(Language);
    Unfortunately JPA does not allow nested fetch joins, so the only way to fecth gea.elementTextAllocation is through a query hint:
    query.setHint("eclipselink.join-fetch", "g.elementAllocation.elementTextAllocation");
    EclipseLink/TopLink's join-fetch query hint is described here:
    http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Query_Hints#Join_Fetch
    Best Regards,
    Chris

  • JPA: Toplink vs Hibernate

    I am using netbeans 5.5 and I want to use JPA. I am in favor of hibernate, but why does the netbeans has toplink being the default persistence library of JPA? What are the difference between toplink and hibernate if I'll be using JPA?
    By the way, I've seen an article "Using JPA in tomcat" and I would really like to use JPA in tomcat as I think it is much faster and lighter than Glassfish. But the article also uses toplink as the persistence library? Could someone guide me in using hibernate?

    This is an video from NetBeans site. Take a look.
    It will open your eyes about Hibernate and TopLink and JPA after you checking the codes that will be generated on your own system application.
    http://www.netbeans.org/download/flash/netbeans_6_gui_builder/netbeans_6_gui_builder.html

  • JPA / Toplink Essentials / How to set Table Qualifier?

    Hello!
    How can i set a table qualifier for toplink essentials (JPA)?
    Using toplink I can use setTableQualifier("...");
    regards
    Harald.

    If I add orm.xml along to persistence.xml in the META-INF directly, TopLink JPA obviously finds it regarding to its log output:
    Searching for default mapping file in file:/C:/<path_to_webapp>/WEB-INF/classes/
    Found a default mapping file at file:/C:/<path_to_webapp>/WEB-INF/classes/META-INF/orm.xml for root URL file:/C:/<path_to_webapp>/WEB-INF/classes/
    But it seems as the "schema" property I set under persistence-unit-defaults is ignored. The orm.xml file looks like this:
    <persistence-unit-metadata>
         <persistence-unit-defaults>
              <schema>schema_name</schema>     
         </persistence-unit-defaults>
    </persistence-unit-metadata>
    The queries logged by TopLink JPA to not add qualifiy table names with the schema_name configured above!!!
    Any idea?
    Hans

  • Spring JPA + Toplink Issues

    Heya,
    I followed a developer works tutorial on integrating Toplink with Spring, and everything seemed to go well, when I start up the application, it looks like Toplink finds all my annotations and validates them (if any where invalid, it sure lets me know). However, when I go to persist my object, I get an IllegalArgumentException:
    Caused by: java.lang.IllegalArgumentException: Object: au.gov.nla.aons2.registry.domain.Registry@f3b83 is not a known entity type.
         at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:3198)
         at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:190)
         at org.springframework.orm.jpa.JpaTemplate$5.doInJpa(JpaTemplate.java:263)
         at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:191)
    My Registry should be valid; at first I thought it was something to do with class hierarchies, but I removed that from the equation and I'm still getting the error. My class looks like this:
    @Entity
    @Table(name="registry", uniqueConstraints= {@UniqueConstraint(columnNames={"name"})})
    public class Registry implements Serializable {
    private static final long serialVersionUID = -4335133039987702902L;
    @Id
    private Long id;
    private String name;
    @Temporal(TemporalType.TIMESTAMP)
         private Calendar lastRun;
    private String url;
    @OneToOne(cascade=CascadeType.ALL)
    @PrimaryKeyJoinColumn
         private Schedule schedule;
         private String status = ScheduleStatus.IDLE;
         public Long getId() {
              return id;
         public void setId(Long id) {
              this.id = id;
         public Calendar getLastRun() {
              return lastRun;
         public void setLastRun(Calendar lastRun) {
              this.lastRun = lastRun;
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
    @Transient
         public String getType()
    throw new RuntimeException("this should be overridden.");
         public String getUrl() {
              return url;
         public void setUrl(String url) {
              this.url = url;
         public Schedule getSchedule() {
              return schedule;
         public void setSchedule(Schedule schedule) {
              this.schedule = schedule;
         public String getStatus() {
              return status;
         public void setStatus(String status) {
              this.status = status;
    My Spring config looks like this:
         <bean id="entityManagerFactory"
              class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
              <property name="jpaVendorAdapter">
                   <bean
                        class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
                        <property name="generateDdl" value="true" />
                        <property name="showSql" value="true" />
                        <property name="databasePlatform"
                             value="oracle.toplink.essentials.platform.database.HSQLPlatform" />
                   </bean>
              </property>
              <property name="dataSource" ref="dataSource" />
              <property name="loadTimeWeaver">
                   <bean
                        class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver" />
              </property>
         </bean>
    My persistence.xml looks like this:
    <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
         <persistence-unit name="aons" transaction-type="RESOURCE_LOCAL">
         </persistence-unit>
    </persistence>
    Finally, and here's the really odd part, my log displays the registering of the Registry Class as a persistence object:
    [TopLink Config]: 2007.04.17 09:32:50.874--ServerSession(21324485)--Thread(Thread[main,5,main])--The alias name for the entity class [class au.gov.nla.aons2.registry.domain.LcDfwRegistry] is being defaulted to: LcDfwRegistry.
    [TopLink Config]: 2007.04.17 09:32:50.890--ServerSession(21324485)--Thread(Thread[main,5,main])--The alias name for the entity class [class au.gov.nla.aons2.registry.domain.Registry] is being defaulted to: Registry.
    [TopLink Config]: 2007.04.17 09:32:50.921--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.Long au.gov.nla.aons2.registry.domain.Registry.id] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:50.937--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String au.gov.nla.aons2.registry.domain.Registry.name] is being defaulted to: NAME.
    [TopLink Config]: 2007.04.17 09:32:50.952--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.util.Calendar au.gov.nla.aons2.registry.domain.Registry.lastRun] is being defaulted to: LASTRUN.
    [TopLink Config]: 2007.04.17 09:32:50.952--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String au.gov.nla.aons2.registry.domain.Registry.url] is being defaulted to: URL.
    [TopLink Config]: 2007.04.17 09:32:50.983--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String au.gov.nla.aons2.registry.domain.Registry.status] is being defaulted to: STATUS.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The discriminator column name for the root inheritance class [class au.gov.nla.aons2.registry.domain.Registry] is being defaulted to: DTYPE.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The alias name for the entity class [class au.gov.nla.aons2.schedule.domain.DayOfMonth] is being defaulted to: DayOfMonth.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The table name for entity [class au.gov.nla.aons2.schedule.domain.DayOfMonth] is being defaulted to: DAYOFMONTH.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.Long au.gov.nla.aons2.schedule.domain.DayOfMonth.id] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.Integer au.gov.nla.aons2.schedule.domain.DayOfMonth.dayOfMonth] is being defaulted to: DAYOFMONTH.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The alias name for the entity class [class au.gov.nla.aons2.registry.domain.GdfrRegistry] is being defaulted to: GdfrRegistry.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The alias name for the entity class [class au.gov.nla.aons2.registry.domain.PronomRegistry] is being defaulted to: PronomRegistry.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The alias name for the entity class [class au.gov.nla.aons2.schedule.domain.Schedule] is being defaulted to: Schedule.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The table name for entity [class au.gov.nla.aons2.schedule.domain.Schedule] is being defaulted to: SCHEDULE.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.Long au.gov.nla.aons2.schedule.domain.Schedule.id] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String au.gov.nla.aons2.schedule.domain.Schedule.scheduleType] is being defaulted to: SCHEDULETYPE.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.Integer au.gov.nla.aons2.schedule.domain.Schedule.hour] is being defaulted to: HOUR.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.Integer au.gov.nla.aons2.schedule.domain.Schedule.minutes] is being defaulted to: MINUTES.
    [TopLink Config]: 2007.04.17 09:32:50.999--ServerSession(21324485)--Thread(Thread[main,5,main])--Element [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.weekdays] is being defaulted to a one to many mapping.
    [TopLink Config]: 2007.04.17 09:32:51.015--ServerSession(21324485)--Thread(Thread[main,5,main])--Element [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.daysOfMonth] is being defaulted to a one to many mapping.
    [TopLink Config]: 2007.04.17 09:32:51.015--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String au.gov.nla.aons2.schedule.domain.Schedule.descriptiveString] is being defaulted to: DESCRIPTIVESTRING.
    [TopLink Config]: 2007.04.17 09:32:51.015--ServerSession(21324485)--Thread(Thread[main,5,main])--The alias name for the entity class [class au.gov.nla.aons2.schedule.domain.Weekday] is being defaulted to: Weekday.
    [TopLink Config]: 2007.04.17 09:32:51.015--ServerSession(21324485)--Thread(Thread[main,5,main])--The table name for entity [class au.gov.nla.aons2.schedule.domain.Weekday] is being defaulted to: WEEKDAY.
    [TopLink Config]: 2007.04.17 09:32:51.015--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.Long au.gov.nla.aons2.schedule.domain.Weekday.id] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:51.015--ServerSession(21324485)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String au.gov.nla.aons2.schedule.domain.Weekday.name] is being defaulted to: NAME.
    [TopLink Config]: 2007.04.17 09:32:51.015--ServerSession(21324485)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to one mapping element [private au.gov.nla.aons2.schedule.domain.Schedule au.gov.nla.aons2.registry.domain.Registry.schedule] is being defaulted to: class au.gov.nla.aons2.schedule.domain.Schedule.
    [TopLink Config]: 2007.04.17 09:32:51.108--ServerSession(21324485)--Thread(Thread[main,5,main])--The primary key column name for the mapping element [private au.gov.nla.aons2.schedule.domain.Schedule au.gov.nla.aons2.registry.domain.Registry.schedule] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:51.108--ServerSession(21324485)--Thread(Thread[main,5,main])--The foreign key column name for the mapping element [private au.gov.nla.aons2.schedule.domain.Schedule au.gov.nla.aons2.registry.domain.Registry.schedule] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:51.108--ServerSession(21324485)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.daysOfMonth] is being defaulted to: class au.gov.nla.aons2.schedule.domain.DayOfMonth.
    [TopLink Config]: 2007.04.17 09:32:51.155--ServerSession(21324485)--Thread(Thread[main,5,main])--The join table name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.daysOfMonth] is being defaulted to: SCHEDULE_DAYOFMONTH.
    [TopLink Config]: 2007.04.17 09:32:51.155--ServerSession(21324485)--Thread(Thread[main,5,main])--The source primary key column name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.daysOfMonth] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:51.155--ServerSession(21324485)--Thread(Thread[main,5,main])--The source foreign key column name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.daysOfMonth] is being defaulted to: Schedule_ID.
    [TopLink Config]: 2007.04.17 09:32:51.155--ServerSession(21324485)--Thread(Thread[main,5,main])--The target primary key column name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.daysOfMonth] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:51.171--ServerSession(21324485)--Thread(Thread[main,5,main])--The target foreign key column name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.daysOfMonth] is being defaulted to: daysOfMonth_ID.
    [TopLink Config]: 2007.04.17 09:32:51.171--ServerSession(21324485)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.weekdays] is being defaulted to: class au.gov.nla.aons2.schedule.domain.Weekday.
    [TopLink Config]: 2007.04.17 09:32:51.171--ServerSession(21324485)--Thread(Thread[main,5,main])--The join table name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.weekdays] is being defaulted to: SCHEDULE_WEEKDAY.
    [TopLink Config]: 2007.04.17 09:32:51.171--ServerSession(21324485)--Thread(Thread[main,5,main])--The source primary key column name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.weekdays] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:51.171--ServerSession(21324485)--Thread(Thread[main,5,main])--The source foreign key column name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.weekdays] is being defaulted to: Schedule_ID.
    [TopLink Config]: 2007.04.17 09:32:51.171--ServerSession(21324485)--Thread(Thread[main,5,main])--The target primary key column name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.weekdays] is being defaulted to: ID.
    [TopLink Config]: 2007.04.17 09:32:51.171--ServerSession(21324485)--Thread(Thread[main,5,main])--The target foreign key column name for the many to many mapping [private java.util.List au.gov.nla.aons2.schedule.domain.Schedule.weekdays] is being defaulted to: weekdays_ID.
    I really don't get it... I think I'm going to have a look at the source and see if I can figure it out. Apart from this problem, I was really enjoying JPA;P

    Okay, I think I've found the problem, but don't know what is causing it. When my code attempts to persist my object, it fails on the Class.equals method. For some reason (classloaders I'll bet), there are two instances of the Class Registry, with two different object ids - so when it calls:
    // Optimize descriptor lookup through caching the last one accessed.
    ClassDescriptor lastDescriptor = this.lastDescriptorAccessed;
    if ((lastDescriptor != null) && (lastDescriptor.getJavaClass().equals(theClass))) {
    return lastDescriptor;
    And should match, the Class.equals() fails:
    public boolean equals(Object obj) {
         return (this == obj);
    So... what now, if it is a class loading issue, how do I ensure that there is only one copy of the Registry class object instantiated. If it isn't a class loading issue, what else could it be?

  • JPA toplink Query cache

    Any idea when performing Query's with Hint but no L2 cache enabled ? Will that object cached / lazyloaded /enriched on access ?
    By the way, whats the default L2 cache setting, is it enable or disabled ? If enable where does it stores, in memory ?
    Thanks
    Newbie

    A shared (L2) cache is enabled by default in TopLink/EclipseLink.
    The cache is in memory.
    Using a query cache, without the shared cache makes little sense, you should use both, or none.
    What will happen if you do is the query cache will be isolated to the session the same as the object cache, so you will get query cache hits for the duration of the persistence context/transaction. i.e. it will be an L1 query cache.
    To configure the cache see,
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/Caching

  • JPA Toplink Essentials SDO_GEOMETRY ORDIMAGE

    I need to support Oracle types such as SDO_GEOMETRY and ORDIMAGE. I've read the chapters in the TopLink 10g Developers Guide on Object Relational Mapping but I'm hoping that someone at Oracle has already done this for the more complex multimedia types required to use options such as Spatial and InterMedia.
    My current limited interest is just in the JPA and I'm only using TopLink Essentials as the Entity Manager provider.

    Answering my own question with respect to Spatial I found the following link
    http://java-persistence.blogspot.com/2007/04/oracle-spatial-using-toplink-essentials.html

  • Using an Oracle SQL Function from JPA/TopLink

    How do I get the return value from a simple (one string input parameter, returns a string) Oracle SQL Function?
    Thanks!

    If you mean calling a stored function in Oracle, you might try something like:
        ValueReadQuery vrq = new ValueReadQuery();
        SQLCall call = new SQLCall("begin ###res := pkg.funcInp(#inp); end;");
        vrq.setCall(call);
        Query q = em.createNativeQuery("");   // we need a Query; any query would do; we replace its contents below
        ((EJBQuery)q).setDatabaseQuery(vrq);
        q.setParameter("inp", "paramValue");
        String result = (String)q.getSingleResult();
        // #=input; ###=output; ####=input/output;
        // if you want to explicitly specify the type of an output parameter, use #### instead of ###,
        // because pure "output" parameters are always treated as java.lang.StringThis will only work in TopLink Essentials, though. I don't know how to do it in Hibernate. I have dealt mainly with TopLink, and just a little with Hibernate.
    In my opinion, it's a HUGE omission not to have support for stored procedures in JPA. Virtually every project I have worked on (in two large companies) has consisted of a large portion of code in stored procedures (sometimes as much as 50% of the overall code). It's a pain to have to go through all that trouble to call the stored procedures.
    Also, pay special attention to TopLink's shared L2 cache. If a stored procedure changes something in the database, TopLink won't know about it and chances are that you will end up with stale objects in the cache which you will either have to refresh, or you'd have to invalidate TopLink's cache for these objects.
    Best regards,
    Bisser

Maybe you are looking for

  • Enabling SSL through Net Manger is not working !!!!!!!

    When configuring SSL in the "Oracle net manager" 1) Should the Service Name also be TCP/IP with SSL or just the Listener Steps I followed: 1) Created a wallet in [READY] mode 2) configured *ora files through net manager 3) Restarted the listner liste

  • All SCOM 2012 R2 dashboards are blank on Windows 7 for any user

    All SCOM dashboards are showing up completely blank on several (but not all) Windows 7 machines and a 2008 R2 server (with RDS)...for any type of user. It's not a permissions issue as the same user can RDP to the SCOM Mgt server and view the dashboar

  • Annual Sales Comparison Analysis by Year - Query

    Hi, I need some help please! I need a query where I can compare sales to the previous year, preferably with manual date range entries. CardCode u2013 CardName u2013 SalesX u2013 SalesY Where the date range is the same but SalesY is for the correspond

  • Failue to load database informaiton in Crystal Reports XI - Foxpro table

    I am using Crystal Reports XI and have run into a very unusual problem.  I have a report (actually several reports) that pull data from a Foxpro .dbf table.  The table and the reports are located on a shared drive.  There are 4 end users, all of whom

  • Syncing different libraries and tailoring content for iOS devices.

    Hi guys, got a couple of iTunes and iOS Questions. First a little background info: I have: - A 16gb iPhone 4s - A 32gb iPod Touch (Probably 1st gen. I got it 2nd hand). I am considering: - a 16gb or 32gb iPad (Wifi only) I used to be a PC user, but h