[hibernate-issues] [Hibernate-JIRA] Created: (ANN-473) uniqueConstraints on super class members

Anthony Patricio (JIRA) noreply at atlassian.com
Mon Oct 23 04:18:04 EDT 2006


uniqueConstraints on super class members
----------------------------------------

         Key: ANN-473
         URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-473
     Project: Hibernate Annotations
        Type: Bug

  Components: binder  
    Versions: 3.2.0.ga    
    Reporter: Anthony Patricio
    Priority: Minor
 Attachments: testcase.zip

very similar to that addressed in the following JIRA using hibernate annotations 3.2.0.CR2
http://opensource.atlassian.com/projects/hibernate/browse/ANN-95 

The super class contains the members we are using for defining the constraint.

The Super class:
----------------------------------------------------
@Entity(name="xpmComponent")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class Component...

@NotNull
@Length(max=40)
@Index(name="manufacturerPartNumber")
public String getManufacturerPartNumber() {
return manufacturerPartNumber;
}

@ManyToOne
@NotNull
@JoinColumn(name="manufacturerId")
public Manufacturer getManufacturer() {
return manufacturer;
}
...



The Entity w/ Unique Constraint:
----------------------------------------------------
@Entity
@Name("xpmProduct")
@Table(name = "xPM_Product",
uniqueConstraints={@UniqueConstraint(
columnNames={"manufacturerPartNumber", "manufacturerId"})})
public class PersistentProduct extends Component...



The Exception which occurs upon deployment
----------------------------------------------------
java.lang.NullPointerException
at org.hibernate.mapping.UniqueKey.sqlConstraintString(UniqueKey.java:20)
at org.hibernate.mapping.Table.sqlCreateString(Table.java:436)
at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:779)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:74)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:311)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:688)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:102)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start()V(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)

runnable testcase attached.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list