[Hibernate-JIRA] Created: (HHH-2524) Criteria query with collection of values (Set<java.lang.String>)
by marco molinari (JIRA)
Criteria query with collection of values (Set<java.lang.String>)
----------------------------------------------------------------
Key: HHH-2524
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2524
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.2
Environment: Java VM : 1.5.0_07
DBMS : HSQLDB
Hibernate: hibernate-3.2.2.ga
Reporter: marco molinari
Hi to all,
I have a problem with Criteria query on collection of values.
Below I wrote a piece of java code and a piece of Person.hbm.xml.
I want to search all persons with the email addresses containing character '@'.
I obtain an empty list of Person and the SQL created by Criteria seems not correct ( more or less ... WHERE lower(PERSON_ID) ? ).
I search information inside Hibernate site and Hibernate book but I didn't found the solution.
public class Person
{
private Long id;
private Set<String> emailAddresses = new HashSet();
public Set<String> getEmailAddresses()
{
return emailAddresses;
}
public void setEmailAddresses(Set<String> emailAddresses) {
this.emailAddresses = emailAddresses;
}
}
public static void main(String[] args)
{
List<Person> list = session.createCriteria(Person.class)
.add( Restrictions.ilike( "emailAddresses", "@", MatchMode.ANYWHERE ) )
.list();
}
Piece of Person.hbm.xml:
<set name="emailAddresses" table="'PERSON_EMAIL_ADDR'" inverse="true">
<key column="'PERSON_ID'"/>
<element column="'EMAIL_ADDR'" type="java.lang.String" not-null="true"/>
</set>
--
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
15 years, 10 months
[Hibernate-JIRA] Created: (BVAL-10) Turn ValidatorParser into a MetadataProvider
by Emmanuel Bernard (JIRA)
Turn ValidatorParser into a MetadataProvider
--------------------------------------------
Key: BVAL-10
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-10
Project: Bean Validation
Issue Type: New Feature
Components: ri-general
Reporter: Emmanuel Bernard
Assignee: Hardy Ferentschik
You should turn parser into something more like a MetadataProvider.
I removed the getValidators() method from parser and moved it to ValidatorImpl. The parser should not be aware of ValidatorImpl, nor Validator for that matter.
The MetadataProvider will be an interface anybody can implement. We will do the annotation version as well as the XML version (and probably some kind of XML overriding annotation version) but one can imagine a Script / Groovy DSLed version, a Programmatic API version and so on.
I imagine a MetadataProvider instance can be passed during the building phase to the ValidatorFactory. The same instance would then be shared for all Validators (kind of make sense, you can't parse XML for every single ValdiatorImpl instantiation).
That woul mean the parser ode needs ot be reworked to be immutable (at least work in concurrent calls)
--
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
15 years, 10 months