-->
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.  [ 4 posts ] 
Author Message
 Post subject: component parent-tag: no access='field' possible?
PostPosted: Fri Jun 02, 2006 11:53 am 
Regular
Regular

Joined: Tue Nov 16, 2004 6:36 pm
Posts: 62
Location: Zürich
Hello, I have a component in a class that points back to it's parent (using the parent tag):

Code:
<hibernate-mapping ... default-access='field'>
<class name='A'>
  <component name='X' class='Y'>
    <parent name='a'>
  </component>
</class>
</hibernate-mapping>


I'm using field access everywhere (default-access = 'field').
Now the field access doesn't seem to work for the parent tag, i.e. for propery a of class Y. I have to define a getter and setter for it (even if private). Also I see that there isn't even an access attribute for the tag parent.

Is there a reason why any property can use field access, but not a property mapped through <parent> ?

Thanks,

Peter


Top
 Profile  
 
 Post subject: bug?
PostPosted: Fri Jul 07, 2006 10:50 am 
Newbie

Joined: Tue Apr 25, 2006 10:34 pm
Posts: 3
Running into the same problem too. Is this going to be fixed in a later version?


Top
 Profile  
 
 Post subject: Same here...
PostPosted: Fri Jul 07, 2006 11:21 am 
Newbie

Joined: Wed Jan 07, 2004 1:56 pm
Posts: 14
Yeah, we are getting the same issue.

Looks like something fell through the cracks with the POJO Component Tuplizer...

I created an issue in Jira..
http://opensource.atlassian.com/project ... e/HHH-1884


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 19, 2007 1:43 pm 
Newbie

Joined: Sat Jan 07, 2006 5:18 pm
Posts: 19
Don't think this has been resolved yet - I'm getting the same problem. Here's the stacktrace I'm getting when building the EntityManagerFactory:

Code:
Caused by: org.hibernate.PropertyNotFoundException: Could not find a setter for property account in class com.xxx.xxx.xxx
   at org.hibernate.property.BasicPropertyAccessor.createSetter(BasicPropertyAccessor.java:216)
   at org.hibernate.property.BasicPropertyAccessor.getSetter(BasicPropertyAccessor.java:209)
   at org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:58)
   at org.hibernate.tuple.component.ComponentEntityModeToTuplizerMapping.<init>(ComponentEntityModeToTuplizerMapping.java:52)
   at org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:50)
   at org.hibernate.mapping.Component.buildType(Component.java:152)
   at org.hibernate.mapping.Component.getType(Component.java:145)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
   at org.hibernate.mapping.Collection.validate(Collection.java:278)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1106)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
   at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
   at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)

The account property is annotated w/ @Parent and is private. Field access is explicitly set for the component as well, and still no go. I was setting this property via the constructor to make the class immutable, but I guess I'll create a setter for now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.