[hibernate-issues] [Hibernate-JIRA] Assigned: (HHH-142) Property with Duplicated name

Diego Pires Plentz (JIRA) noreply at atlassian.com
Tue Aug 7 22:01:11 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Diego Pires Plentz reassigned HHH-142:
--------------------------------------

    Assignee: Diego Pires Plentz

> Property with Duplicated name
> -----------------------------
>
>                 Key: HHH-142
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-142
>             Project: Hibernate3
>          Issue Type: Improvement
>          Components: metamodel
>    Affects Versions: 3.0 beta 4, 3.1 rc3
>         Environment: WinXP, Hibernate 3 from CVS (2005.02.19) J2SE 5.0
>            Reporter: Konstantin Sharenkov
>            Assignee: Diego Pires Plentz
>            Priority: Minor
>             Fix For: 3.0 rc 1
>
>
> When I tryed to Implement Parametrized user type to support 
> Native J2SE 5.0 Enums as VARCHAR. 
> I randomply detect that I able to set 2 properties with the same name at one class.
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping
>     PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
>     "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping package="com.enterra.tth.po" >
>     <typedef class="com.enterra.tth.po.NativeEnumType" name="ActorAttributeType">
>         <param name="enumClass">com.enterra.tth.po.ActorAttribute$Type</param>
>     </typedef>
>     
>     <class name="ActorAttribute" table="t_actor_attribute" optimistic-lock="version" >
>         <cache usage="read-write"/>
>         <!-- Standrt part of mapping -->
>         <id name="id" type="string" >
>             <column name="f_id" sql-type="char(32)" not-null="true"/>
>             <generator class="uuid.hex"/>
>         </id>
>         
>         ...
>         <property name="type" type="ActorAttributeType">
>             <column name="f_type" sql-type="varchar"/>
>         </property>
>         <property name="type" type="string">
>             <column name="f_value" sql-type="varchar"/>
>         </property>
>     </class>
> </hibernate-mapping>
> See property "type".
> Aclually getter and setter use com.enterra.tth.po.ActorAttribute$Type
> But both in background will use VARCHAR.
> As result I recieved class cast exception  com.enterra.tth.po.ActorAttribute$Type to String.
> I think it will be better to disable duplicated properties.
> Or generate warning may be.
> Thanks.
> PS. 
> After I update Hibernate 3 from cvs today and rebuild it
> I have started to recieve following exception.
> java.lang.NullPointerException
> 	at org.hibernate.tuple.PojoTuplizer.handleProperty(PojoTuplizer.java:82)
> 	at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:77)
> 	at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:53)
> 	at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:45)
> 	at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:202)
> 	at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:398)
> 	at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)
> 	at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
> 	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:198)
> 	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
> Hope it will help you too.

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