1 Reply Latest reply on Jan 10, 2006 9:03 AM by milan wölke

    Problems with Enums and Inheritance

    milan wölke Newbie

      Hello,

      I've a problem with entitybeans that use inheritance and enums. I have a entitybean baseclass A which besides other things contains an enum value.
      Derived from that I created another entitybean class B.

      If I create an instance of A and persist it using entityManager.persist() it works fine. But if I instanciate B and call entityManager.persist() I get the following exception:

      12:15:28,620 WARN [EnumType] Unable to guess enum type, default to INTEGER
      java.sql.SQLException: Nicht unterstützte Funktion
       at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
       at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
       at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
       at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:690)
       at oracle.jdbc.driver.OracleParameterMetaData.getParameterType(OracleParameterMetaData.java:154)
       at org.hibernate.type.EnumType.guessTypeByParameter(EnumType.java:200)
       at org.hibernate.type.EnumType.guessType(EnumType.java:147)
       at org.hibernate.type.EnumType.nullSafeSet(EnumType.java:113)
       at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:145)
       at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1816)
       at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1793)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2049)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2417)
       at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:227)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:877)
       at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:185)
       at org.jboss.ejb3.entity.ManagedEntityManagerFactory$SessionSynchronization.beforeCompletion(ManagedEntityManagerFactory.java:89)
       at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1473)
       at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1092)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:306)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:162)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:74)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:189)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:69)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:566)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:436)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:247)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:299)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:169)


      Am I doing something wrong or did I find a bug.

      regards, milan wölke