[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2782?page=c...
]
Christian Jaeger commented on HHH-2782:
---------------------------------------
This bug is still present in the current version (Branch 3.2 and Trunk).
Branch 3.1 does not show it.
It is a major issue because this bug makes the dynamic components nearly unusable.
In addition to having the rebuildType() method added, I'd suggest the following
solution:
When the component is declare as "dynamic", buildType() should be called
automatically every time getType() is accessed.
This way, this bug should be quite easy to fix.
Component getType caches the type value
---------------------------------------
Key: HHH-2782
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2782
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.2.5
Environment: all
Reporter: Kiss Zoltán
Component class caches the value of the type attribute:
public Type getType() throws MappingException {
// added this caching as I noticed that getType() is being called multiple
times...
if ( type == null ) {
type = buildType();
}
return type;
}
This forbids the use of 'dynamic attributes'.
For eg. if you try to add new properties to an existing dynamic-component with the
addProperty method, then the rebuild of the session factory will failed, because the
Component property will be invalid during the validation (in the Component there will be a
different column span value, then in the cached ComponentType).
There should be a method like this in the Component class:
public void rebuildType() {
type = buildType();
}
With the help of this the type could be rebuild if it is necessary.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira