[Hibernate-JIRA] Created: (HHH-2034) Potential ClassCastException in catch block in NullableType
by Galen Palmer (JIRA)
Potential ClassCastException in catch block in NullableType
-----------------------------------------------------------
Key: HHH-2034
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2034
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.1.3
Environment: Hibernate 3.1.3
Reporter: Galen Palmer
Priority: Minor
It is possible to throw an exception from within the catch block of NullableType.nullSafeSet() since the toString(value) method calls in many cases (e.g. StringType) simply result in a cast of return (String)value. This may mask the underlying problem for the users.
A proposed solution would be to replace the call in the catch blog of toString(value) with a reference to value. For example:
line 87:
log().info( "could not bind value '" + value + "' to parameter: " + index + "; " + re.getMessage() );
and line 91:
log().info( "could not bind value '" + value + "' to parameter: " + index + "; " + se.getMessage() );
This change would prevent the catch block from throwing the exception.
--
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
17 years, 3 months
[Hibernate-JIRA] Created: (ANN-531) EntityMode.DOM4J does not deserialize collection entities
by Laurent Perez (JIRA)
EntityMode.DOM4J does not deserialize collection entities
---------------------------------------------------------
Key: ANN-531
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-531
Project: Hibernate Annotations
Type: Bug
Components: binder
Versions: 3.2.2
Environment: PATCH ANN-517 APPLIED (see http://opensource.atlassian.com/projects/hibernate/browse/ANN-517), revision 11026.
Reporter: Laurent Perez
The XML deserialization of an entity does not deserializes its child properties but only its id, following sample :
Foobean are children of a Screen :
@Entity
@Table (name="foobean")
public class Foobean implements java.io.Serializable {
private String name;
private String age;
private Screen screen;
@Id
@Column(name="name")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@ManyToOne
public Screen getScreen() {
return this.screen;
}
public void setScreen(Screen screen) {
this.screen = screen;
}
@Column(name="age")
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
}
Relevant parent Screen annotations :
private Set<Foobean> fooBeans = new HashSet<Foobean>();
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
public Set<Foobean> getFoobeans(){
return this.fooBeans;
}
public void setFoobeans(Set<Foobean> fooBeans) {
this.fooBeans = fooBeans;
}
Association :
Foobean foobean = new Foobean();
foobean.setName("foo");
foobean.setAge("age");
foobean.setScreen(screen);
screen.getFoobeans().add(foobean);
Generated XML (the age property of Foobean is missing, i.e there is no <name>foo</name><age>age</age>) :
<Screen>
<id>1</id>
<foobeans>
<Foobean>foo</Foobean>
</foobeans>
</Screen>
--
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
17 years, 3 months
[Hibernate-JIRA] Created: (HHH-2376) Query with fully qualified entity class fails
by Neukomm (JIRA)
Query with fully qualified entity class fails
---------------------------------------------
Key: HHH-2376
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2376
Project: Hibernate3
Type: Bug
Components: query-hql
Versions: 3.2.1
Environment: Hibernate 3.2.1ga, HSQLDB 1.8.0.4
Reporter: Neukomm
Attachments: DiscriminatorTest2.java
We've recently ran into a problem while migrating from Hibernate 3.1.1 to Hibernate 3.2.1ga:
While queries against the class attribute still work, if the class is non-qualified, the query fails if the
name is fully qualified.
e.g.
"from Person p where p.class = Person"
works fine while
"from Person p where p.class = org.hibernate.test.discriminator.Person"
fails.
I've attached a test case to illustrated the problem. It should work when it's put into the
'discriminator' package of the hibernate junit test cases.
Both testcases work fine for hibernate versions up to and including 3.2.0cr2.
In later versions, specifically in 3.2.1ga, the test case that uses the fully qualified class name
('testQueryWithPackage') fails.
--
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
17 years, 3 months