[Hibernate-JIRA] Created: (HV-445) Ensure meta models are completely unmodifiable
by Gunnar Morling (JIRA)
Ensure meta models are completely unmodifiable
----------------------------------------------
Key: HV-445
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-445
Project: Hibernate Validator
Issue Type: Improvement
Reporter: Gunnar Morling
Fix For: 4.2.0.CR1
The internal meta model (BeanMetaDataImpl et al.) as well as the external one (BeanDescriptorImpl et al.) should be completely unmodifiable, as they could potentially be accessed from multiple threads at the same time.
I made some more fields final/unmodifiable with HV-371, but there are some places left which I couldn't change easily and need some more consideration:
* ConstraintDescriptorImpl#compositionType
* ElementDescriptorImpl#constraintDescriptors
* BeanMetaDatImpl#cascadedMembers (could be made unmodifiable after initialization instead of creating a new unmodifiable set with each call of getCascadedMembers()
When looking through the model I found it quite complex to find out which collection fields are already unmodifiable and which not. I therefore thought about introducing a marker annotation @Unmodifiable which could be used to document unmodifiable fields. WDYT?
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-4962) @ManyToOne with @JoinTable fails
by Clint Popetz (JIRA)
@ManyToOne with @JoinTable fails
--------------------------------
Key: HHH-4962
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4962
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.2
Reporter: Clint Popetz
$ cat src/main/java/test/User.java
package test;
import javax.persistence.*;
import org.hibernate.envers.Audited;
import java.util.Set;
The below code fails with "org.hibernate.MappingException: Unable to read the mapped by attribute for widgets in test.User!" but is supported by JPA, at least under hibernate.
@Entity
@Audited
public class User
{
@Id
private long id;
@OneToMany(mappedBy="user")
private Set<Widget> widgets;
}
$ cat src/main/java/test/Widget.java
package test;
import javax.persistence.*;
import org.hibernate.envers.Audited;
@Entity
@Audited
public class Widget
{
@Id
private long id;
@ManyToOne(fetch=FetchType.LAZY)
@JoinTable(name = "widget_to_user",
joinColumns = @JoinColumn(name = "widget_id"),
inverseJoinColumns = @JoinColumn(name = "user_id"))
private User user;
}
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-5291) Hibernate generates several join clauses for same table
by Igor Nikolaev (JIRA)
Hibernate generates several join clauses for same table
-------------------------------------------------------
Key: HHH-5291
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5291
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.2
Environment: Hibernate 3.5.2
Reporter: Igor Nikolaev
Suppose you've got a mapping:
<class name="Class" table="TABLE1" dynamic-update="true">
<id name="id" type="int">
<column name="ID" />
<generator class="assigned" />
</id>
<discriminator column="CLASS_TYPE"/>
<property name="property1" type="string" column="PROPERTY1" update="false" insert="false"/>
<join table="TABLE2" optional="true">
<key column="ID" not-null="false"/>
<property name="property2" column="PROPERTY2"/>
</join>
<subclass name="Subclass" discriminator-value="SUBCLASS">
<join table="TABLE2">
<key column="swift_id"/>
<property name="property3" column="PROPERTY3"/>
</join>
</subclass>
</class>
As you can notice, we join the same table in subclass.
Expected result is that Hibernat generates a query like this one:
select
this_.ID,
this_.PROPERTY1,
this_1_.PROPERTY2,
this_1_.PROPERTY3
from
TABLE1 this_
left inner join
TABLE2 this_1_
on this_.ID=this_1_.ID
Instead, Hibernate joins TABLE2 twice and generates the following query:
select
this_.ID,
this_.PROPERTY1,
this_1_.PROPERTY2,
this_2_.PROPERTY3
from
TABLE1 this_
left inner join
TABLE2 this_1_
on this_.ID=this_1_.ID
left outer join
TABLE2 this_2_
on this_.ID=this_2_.ID
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HV-264) Validation of List of primitives
by Michenaud Laurent (JIRA)
Validation of List of primitives
--------------------------------
Key: HV-264
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-264
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.0.1
Environment: Linux
Reporter: Michenaud Laurent
Hi,
I have a list of String in my bean :
These strings are email and i want to validate them.
So, i did in my bean :
@NotEmpty
@Email
//@Valid <= uncommenting that line doesnot change anything.
List<String> emails ;
At execution, i've got the error :
Exception in thread "main" javax.validation.UnexpectedTypeException: No validator could be found for type: java.util.List<java.lang.String>
at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:236)
at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:219)
at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:167)
at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:113)
at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:121)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:334)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForRedefinedDefaultGroup(ValidatorImpl.java:278)
at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:260)
at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:213)
at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:119)
at com.adeuza.movalys.validation.hibernate.TestMain.main(TestMain.java:75)
I don't know if it is a bug in hibernate validator. I have looked at the JSR303 and i have not seen anything
about List of primitives. You can validate per example List<Person> with @Valid and it works well because
the validator knows about Person class.
I have used a little the Oval framework and with it, you can tell if the check applies to the container,
or the values inside, or the keys(for map). I don't know if you can do that with JSR303.
I'm interesting with your point of view.
--
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
12 years, 9 months