[Hibernate-JIRA] Created: (BVAL-175) validateValue incorrectly reports java.lang.IllegalArgumentException: Invalid property path. There is no property listOfString in entity simple_bv_servlet.Person
by Ed Burns (JIRA)
validateValue incorrectly reports java.lang.IllegalArgumentException: Invalid property path. There is no property listOfString in entity simple_bv_servlet.Person
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: BVAL-175
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-175
Project: Bean Validation
Issue Type: Bug
Affects Versions: 4.0.0.Alpha2
Environment: HEAD of JSR-303 RI
Reporter: Ed Burns
Calling validator.validateValue() seems to fail when it shouldn't.
Consider this pojo:
8<----------------------------------
package simple_bv_servlet;
import java.util.List;
import javax.validation.constraints.NotNull;
public class Person {
@NotNull
private String firstName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
@NotNull
private String lastName;
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
private List<String> listOfString;
public List<String> getListOfString() {
return listOfString;
}
public void setListOfString(List<String> listOfString) {
this.listOfString = listOfString;
}
}
8<----------------------------
And consider this selvlet which validates this pojo in its doGet() impl.
8<--------------------------------------
package simple_bv_servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.ValidatorContext;
import javax.validation.ValidatorFactory;
public class SimpleBVServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
PrintWriter out = resp.getWriter();
resp.setContentType("text/html");
out.print("<html><head><title>SimpleBVServlet</title></head><body>");
ValidatorFactory validatorFactory = null;
validatorFactory = Validation.buildDefaultValidatorFactory();
out.print("<p>");
out.print("Obtained ValidatorFactory: " + validatorFactory + ".");
out.print("</p>");
ValidatorContext validatorContext = validatorFactory.usingContext();
javax.validation.Validator beanValidator = validatorContext.getValidator();
out.print("<h1>");
out.print("Validating invalid person class using validateValue.");
out.print("</h1>");
List<String> value = new ArrayList<String>();
value.add("one");
value.add("two");
value.add("three");
Set<ConstraintViolation<Person>> violations =
beanValidator.validateValue(Person.class, "listOfString", value);
if (violations.isEmpty()) {
out.print("<p>");
out.print("No ConstraintViolations found.");
out.print("</p>");
} else {
for (ConstraintViolation<Person> curViolation : violations) {
out.print("<p>");
out.print("ConstraintViolation: message: " + curViolation.getMessage() +
" propertyPath: " + curViolation.getPropertyPath());
out.print("</p>");
}
}
Person person = new Person();
out.print("<h1>");
out.print("Validating invalid person instance using validate.");
out.print("</h1>");
violations = beanValidator.validate(person);
if (violations.isEmpty()) {
out.print("<p>");
out.print("No ConstraintViolations found.");
out.print("</p>");
} else {
for (ConstraintViolation<Person> curViolation : violations) {
out.print("<p>");
out.print("ConstraintViolation: message: " + curViolation.getMessage() +
" propertyPath: " + curViolation.getPropertyPath());
out.print("</p>");
}
}
out.print("<h1>");
out.print("Validating valid person.");
out.print("</h1>");
person.setFirstName("John");
person.setLastName("Yaya");
violations = beanValidator.validate(person);
if (violations.isEmpty()) {
out.print("<p>");
out.print("No ConstraintViolations found.");
out.print("</p>");
} else {
for (ConstraintViolation<Person> curViolation : violations) {
out.print("<p>");
out.print("ConstraintViolation: message: " + curViolation.getMessage() +
" propertyPath: " + curViolation.getPropertyPath());
out.print("</p>");
}
}
out.print("</body></html>");
}
}
8<------------------------
The call to
Set<ConstraintViolation<Person>> violations =
beanValidator.validateValue(Person.class, "listOfString", value);
causes this exception to be thrown:
java.lang.IllegalArgumentException: Invalid property path. There is no property listOfString in entity simple_bv_servlet.Person
But I say, doch, there is such a property on the Person.
This is new behavior in 4.0.0.Beta2, and it's breaking Glassfish.
Thanks,
Ed
--
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
14 years, 7 months
[Hibernate-JIRA] Commented: (HHH-1803) Allow fetching with criteria when scrolling
by Filip Neven (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1803?page=c... ]
Filip Neven commented on HHH-1803:
----------------------------------
Why isn't this issue being fixed? It's taking a very long time, and apparently it concerns many developers.
> Allow fetching with criteria when scrolling
> -------------------------------------------
>
> Key: HHH-1803
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1803
> Project: Hibernate Core
> Issue Type: Improvement
> Components: query-criteria
> Affects Versions: 3.2.0.cr2
> Reporter: Maarten Winkels
> Attachments: Child.java, criteria-scroll-fetch-collection.patch, CriteriaScrollFetchTest.java, Diffs-applied-to-3.3.2.GA.zip, Parent.java, ParentChild.hbm.xml
>
>
> When querying by criteria, fetching is allowed, but when scrolling a criteria, the fetching corrupts the result.
--
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
14 years, 7 months
[Hibernate-JIRA] Created: (ANN-825) TestCase could check for superclass of Dialect before skipping it
by Juraci Paixao Krohling (JIRA)
TestCase could check for superclass of Dialect before skipping it
-----------------------------------------------------------------
Key: ANN-825
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-825
Project: Hibernate Annotations
Issue Type: Improvement
Reporter: Juraci Paixao Krohling
Assignee: Hardy Ferentschik
Attachments: ANN-CheckSuperclassDialectsBeforeSkip.diff
If a subclass of org.hibernate.test.annotations.TestCase is annotated with @RequiresDialect (or any of its methods), TestCase tries to match the exact name of the dialect in order to decide to skip it or not.
My suggestion (and the attached patch) adds another check. If I specify the superclass of a set of dialects (like Oracle8iDialect, which is superclass of Oracle9i and Oracle10g), the test won't skip the subclasses of Oracle8iDialect.
How to reproduce:
1) Create a test case annotated with @RequiresDialect(Oracle8iDialect.class)
2) Configure the test to run using the Oracle9iDialect
3) The test will be skipped, even though Oracle9iDialect is a subclass of Oracle8iDialect
After the patch, the step 3 would be:
3) The test is not skipped.
If there's a reason to not check the superclasses, please reject this JIRA. Otherwise, please review it and commit (or assign it back to me to commit).
--
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
14 years, 7 months
[Hibernate-JIRA] Commented: (HHH-1395) Hierarchical entity data management using 'modified preorder tree traversal algorithm' (nested set trees)
by Joonas Koivunen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1395?page=c... ]
Joonas Koivunen commented on HHH-1395:
--------------------------------------
Has anyone made progress on Christians first version? It looks good, but it's lacking the ability of moving trees which I'm having trouble implementing.
It'd seem that post-update event is *not* the way to go.
> Hierarchical entity data management using 'modified preorder tree traversal algorithm' (nested set trees)
> ----------------------------------------------------------------------------------------------------------
>
> Key: HHH-1395
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1395
> Project: Hibernate Core
> Issue Type: New Feature
> Components: core, query-hql
> Environment: Hibernate 3.1 plus Annotations extending EJB3 implementation
> Reporter: James Salt
> Attachments: nestedset.tar.gz
>
> Original Estimate: 3 weeks
> Remaining Estimate: 3 weeks
>
> An enhancement to allow entities to exist in a managed tree (DAG) structure, via the use of property annotations and entity annotations. With an extension to the HQL language to mimic the Oracle recusive query clause.
> This would be classically be useful for Bill of Material uses, or any tree like entity structure.
> I have implemented a homebrew approach using the 'adjacency list method' , and a post persist call back method to set the node path. Although I think a more full blown optimised algorithm would be the 'modified preorder tree traversal algorithm'.
> In the annotations world this could be implemented using an annotation like @Hierarchical to the entity, with a @Parent (mask for @ManyToOne) annotation on the parent field/parameter and @Children (mask for @OneToMany) annotation on the list of children entities.
> Then a postupdate method could be implemented for the entity type, that recalculates the tree meta data -i.e. parent, left and right.
> I believe this would be a valuable extension (useful for many common data models) to the hibernate core product that could be exposed through annotations as I have discussed and the hbm.xml.
> The users of such a system would be aware of the performance implications on insert/update/delete, but gain a massive performance gain on querying a tree data model.
>
--
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
14 years, 7 months
[Hibernate-JIRA] Created: (HHH-4491) NPE in HQL subselect
by John Hutcheson (JIRA)
NPE in HQL subselect
--------------------
Key: HHH-4491
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4491
Project: Hibernate Core
Issue Type: Bug
Environment: HIB3.2.3 & 3.2.4 H2 on win32
Reporter: John Hutcheson
this fails:
<code>
select cg, (exists(select caer from nz.org.wpc.crm.dao.CivicrmAclEntityRole$Group as caer
where caer.aclRoleId = :roleId
and caer.entityId = cg.id))
from CivicrmGroup as cg
</code>
exception is
java.lang.NullPointerException
at org.hibernate.hql.ast.ParameterTranslationsImpl.getNamedParameterExpectedType(ParameterTranslationsImpl.java:63)
at org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:296)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:97)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
<B>this works:</B>
<code>
select cg, (exists(select caer from nz.org.wpc.crm.dao.CivicrmAclEntityRole$Group as caer
where caer.aclRoleId = 1
and caer.entityId = cg.id))
from CivicrmGroup as cg
</code>
--
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
14 years, 7 months
[Hibernate-JIRA] Commented: (HHH-1829) Allow join on any property using property-ref
by Mathieu Gervais (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829?page=c... ]
Mathieu Gervais commented on HHH-1829:
--------------------------------------
Hi Anthony/Steve,
We are working on uploading a clean svn diff. Sorry about the delay.
> Are you both using 3.2.5?
Yes.
> Allow join on any property using property-ref
> ---------------------------------------------
>
> Key: HHH-1829
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829
> Project: Hibernate Core
> Issue Type: New Feature
> Components: metamodel
> Affects Versions: 3.2.0 cr1, 3.2.0.cr2
> Reporter: Maarten Winkels
> Assignee: Anthony Patricio
> Attachments: AbstractJoinTest.java, HHH-1829-mwinkels.patch, hhh-1829.patch, JoinNoPropertyRefTest.java, JoinPropertyRefTest.java, Person.hbm.xml, Person.java, PersonNoPropertyRef.hbm.xml
>
>
> Currently joining tables for one class (uing the <join...> tag) is only supported for the id property. The property-ref is allowed on the <key..> tag inside the <join..> tag, but this is ignored.
--
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
14 years, 7 months