[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4119) Duplicate alias

roger cheng (JIRA) noreply at atlassian.com
Thu Sep 10 23:27:50 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33934#action_33934 ] 

roger cheng commented on HHH-4119:
----------------------------------

I just saw a comment in 'processQuery(AST select, AST query)' of class org.hibernate.hql.ast.HqlSqlWalker:
	//TODO: the only reason we need this stuff now is collection filters,
	//      we should get rid of derived select clause completely!

If the derived select clause can be got rid of, the duplicate alias is not problem, and can you give some temporary proposal to resolve this issue,
thank you very much.

> Duplicate alias 
> ----------------
>
>                 Key: HHH-4119
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4119
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.5
>         Environment: Hibernate 3.2.5, database sybase 12.52
>            Reporter: roger cheng
>         Attachments: SybaseIssue.tar.gz
>
>
> The mapping file I used:
> <hibernate-mapping package="com.novell.uddi3.hibernate.entities">
> 	<class name="BusinessVO" table="businessvo">
> 		<id name="id" type="string">
> 			<generator class="assigned" />
> 		</id>
> 		<list name="Contacts" cascade="delete" lazy="true">
> 			<key column="bid" />
> 			<list-index column="sortorder"/>
> 			<one-to-many class="ContactVO" />
> 		</list>
> 	</class>
> 	<class name="ContactVO" table="contacts">
> 		<id name="id">
> 			<generator class="native"/>
> 		</id>
> 		<array name="PersonName" cascade="all" table="personnames" fetch="join">
> 			<key column="cid" />
> 			<list-index column="sortorder"/>
> 			<composite-element class="org.uddi.v3.core.PersonName">
> 				<property name="_value" type="string" column="personname" length="4000"/>
> 			</composite-element>
> 		</array>
> 	</class>
> </hibernate-mapping>
> When I execute a hsql like following:
> 	Query q = session.createQuery("from BusinessVO b" +
> 			" left join fetch b.Contacts c" +
> 			" left join fetch c.PersonName");
> 	BusinessVO vo = (BusinessVO)q.uniqueResult();
> From the console, the following sql was created:
>     select
>         businessvo0_.id as id0_0_,
>         contacts1_.id as id1_1_,
>         personname2_.cid as cid1__,
>         personname2_.personname as personname1__,
>         personname2_.sortorder as sortorder1__,
>         contacts1_.bid as bid0__,
>         contacts1_.id as id0__,
>         contacts1_.sortorder as sortorder0__,
>         personname2_.cid as cid1__,
>         personname2_.personname as personname1__,
>         personname2_.sortorder as sortorder1__ 
>     from
>         businessvo businessvo0_ 
>     left outer join
>         contacts contacts1_ 
>             on businessvo0_.id=contacts1_.bid 
>     left outer join
>         personnames personname2_ 
>             on contacts1_.id=personname2_.cid
> The alias 'cid1__, personename1__, sortorder1__' are duplicate, is this a bug of hibernate?

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