-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Table not found error using @Inheritance and @JoinTable
PostPosted: Sat Jan 13, 2007 4:36 pm 
Beginner
Beginner

Joined: Wed Jan 03, 2007 7:47 pm
Posts: 23
Location: Richardson, Texas
Greetings,

I am using EJB 3/Hibernate 3.2/Glassfish Configuration.

I have an entity class in a legacy data model which maps to the base table of a JOINED inheritance hierarchy (not using discriminator) defined with the following :

Code:
@Entity
@Table(name="service")
@Inheritance(strategy=InheritanceType.JOINED)
public class Service implements Serializable


Here is the sub-class :

Code:
@Entity
@Table(name="access_service")
@PrimaryKeyJoinColumn(name="service_id")
public class AccessService extends Service implements Serializable


This was working fine until I added a join table annotation to the Service
class as this class has another relationship. Here is the code for it :

Code:
@OneToOne(optional=true, fetch=FetchType.LAZY,cascade=CascadeType.PERSIST)
@JoinTable(name="current_service_char",
        joinColumns = @JoinColumn(name="service_id"),
        inverseJoinColumns = @JoinColumn(name="service_char_id")
    )
private ServiceChar currentServiceChar;


Once I add the @JoinTable, I receive the following error and stack trace during deployment. Again, both of these work fine independently but once I support together, I receive the error.

Thanks for any acceptance or recommendations.
Regards, Kurt

Code:
Table current_service_char not found   at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:461)   at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:240)   at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)   at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)   at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)   at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:195)   at com.sun.enterprise.server.PersistenceUnitLoaderImpl.load(PersistenceUnitLoaderImpl.java:91)   at com.sun.enterprise.server.AbstractLoader.loadPersistenceUnits(AbstractLoader.java:853)   at com.sun.enterprise.server.EJBModuleLoader.load(EJBModuleLoader.java:152)   at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:219)   at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:174)   at com.sun.enterprise.server.StandAloneEJBModulesManager.moduleDeployed(StandAloneEJBModulesManager.java:406)   at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:954)   at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:941)   at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:448)   at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:160)   at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:296)   at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:203)   at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:285)   at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:119)   at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)   at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)   at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:263)   at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:281)   at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(ApplicationsConfigMBean.java:534)   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)   at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:353)   at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:336)   at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:448)   at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)   at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)   at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)   at java.lang.reflect.Method.invoke(Method.java:597)   at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:77)   at $Proxy1.invoke(Unknown Source)   at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:297)   at com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymentService(AutoDeployer.java:413)   at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:394)   at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:253)   at com.sun.enterprise.deployment.autodeploy.AutoDeployControllerImpl$AutoDeployTask.run(AutoDeployControllerImpl.java:358)   at java.util.TimerThread.mainLoop(Timer.java:512)   at java.util.TimerThread.run(Timer.java:462)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 21, 2007 7:02 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
JOINED strategy is not compatible with @SecondaryTable in Hibernate and this is the way @OneToOne with @JoinTable is implemented

You can change your strategy to SINGLE_TABLE and mix it with @SecondaryTable to achieve the equivalent of JOINED, then @JoinTable for @OneToOne will work

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Table not found error using @Inheritance and @JoinTable
PostPosted: Mon Jan 22, 2007 9:21 am 
Beginner
Beginner

Joined: Wed Jan 03, 2007 7:47 pm
Posts: 23
Location: Richardson, Texas
Emmanual,

Thanks for the explanation!

Regards,
Kurt


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.