[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2159) Query that previously worked in 3.2.0CR2 does not work anymore

Andy Dale (JIRA) noreply at atlassian.com
Fri Oct 20 10:16:04 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2159?page=comments#action_24915 ] 

Andy Dale commented on HHH-2159:
--------------------------------

The single table inheritance strategy being used is not that simple.  If i ever got hibernate to work with eclipse or to so i could test the mappings i might be able to help more.  The mapping i currently have is:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
	<class name="Expression" table="experssionHierarchy">
  		<id name="id" column="expression_id" type="int" />
  		<discriminator column="discrim" type="string"/>
  		<property name="expr" type="string" />
  		<property name="description" type="string" />
  		<property name="type" type="Expression.ExpressionType" not-null="true" />  		
		
		<set name="mExpressionTargets"
                    inverse="true"
                    cascade="save-update">
                        <key column="exptarg_id"/>
                        <one-to-many class="ExpressionTarget"/>
        </set>
        
        <subclass name="Rule" discriminator-value="rule">
        	<set name="Restrictions" table="expressionHierarchy_restrictions">
        		<key column="expression_id"/>
        		<many-to-many column="expression_id"
            		unique="true"
            		class="Expression"/>
    		</set> 
        </subclass>
        <subclass name="Restriction" discriminator-value="restriction">        	
        </subclass>
  	</class>  	  	
</hibernate-mapping>

I am not sure on how to specify the many-to-one between the 2 subclasses of the parent class.  But that aside form that it might work in standalone hibernate but that does not matter to me as i am using hibernate as the underlying persistence layer of JBoss and not in stand alone mode. So maybe the problem lies in the integration of hibernate and jboss.



> Query that previously worked in 3.2.0CR2 does not  work anymore
> ---------------------------------------------------------------
>
>          Key: HHH-2159
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2159
>      Project: Hibernate3
>         Type: Bug

>     Versions: 3.2.0.ga
>  Environment: hibernate 3.2.0GA, PostgreSQL 8.1.4 (using build 407 of the JDBC driver).  JDK 1.5.0_06, JBoss 4.0.4GA, Operating system is Fedora Core 5
>     Reporter: Andy Dale
>  Attachments: hibernate_testcase.tar.gz
>
>
> First off i do not know if this bug belongs to the Hibernate3(core) or Hibernate EntityManger branch, but have entered it against core because that is where the exception occurs (in org.hibernate.hql.ast.tree.FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements).
> I have a relativley simple entity setup up to test a proof of concept.  Persisting the data to the database is not a problem in the new version 3.2.0.GA, but the problems occurs when trying to perform a query on the persisted data, the very same query works with 3.2.0CR2 but gives a nullPointException in 3.2.0GA.
> I have attached the java source for the entities + session bean (in hibernate_testcase.tar.gz/entities file) and the java class (in hibernate_testcase.tar.gz/service file) that is used to persist and query the data, and because this was only meant to be a proof of concept i have also included the .ear archive as apart from the entity definitions and session bean the only other thing it contains is a JBoss .sar archive which calls the static persist and query methods in the session bean (service test.testcase).  Please note to use the .ear archive you need a datasource called Postgres_Test

-- 
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