[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2946) @AttributeOverride of column type or name results in PropertyNotFoundException
Juan Antonio Agudo (JIRA)
noreply at atlassian.com
Mon Nov 12 20:47:29 EST 2007
@AttributeOverride of column type or name results in PropertyNotFoundException
------------------------------------------------------------------------------
Key: HHH-2946
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2946
Project: Hibernate3
Issue Type: Bug
Environment: Hibernate 3.2.5.ga, Annotations 3.3.0.ga, Spring 2.0.7, MySQL 5.0.41-community-nt, Windows Vista
Reporter: Juan Antonio Agudo
Attachments: hibernateErrorTest.zip
When trying to map a java.util.Map<String,String> hibernate by default creates VARCHAR(256) fields. When an attempt to alter for e.g. the column type to "TEXT" an Exception is thrown. For example:
@CollectionOfElements
@AttributeOverride(name="element.value", column=@Column(columnDefinition="TEXT"))
public Map<String, String> getSettings() {
return settings;
}
results in
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [C:\Users\tag\workspace\xyz\conf\applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.PropertyNotFoundException: Could not find a setter for property bytes in class java.lang.String
Caused by: org.hibernate.PropertyNotFoundException: Could not find a setter for property bytes in class java.lang.String
at org.hibernate.property.BasicPropertyAccessor.createSetter(BasicPropertyAccessor.java:216)
at org.hibernate.property.BasicPropertyAccessor.getSetter(BasicPropertyAccessor.java:209)
at org.hibernate.mapping.Property.getSetter(Property.java:277)
at org.hibernate.tuple.component.PojoComponentTuplizer.buildSetter(PojoComponentTuplizer.java:137)
at org.hibernate.tuple.component.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:44)
at org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:38)
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.mapping.IndexedCollection.validate(IndexedCollection.java:67)
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)
This behaviour can be reproduced and was described fully in http://forum.hibernate.org/viewtopic.php?p=2368889#2368889
I attached an isolated sample code for review purposes.
--
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