[Hibernate-JIRA] Created: (HV-452) Incorrect Paths when using fluent API to add constraints to a context
by Glen Hilton (JIRA)
Incorrect Paths when using fluent API to add constraints to a context
---------------------------------------------------------------------
Key: HV-452
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-452
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.2.0.Beta2, 4.2.0.Beta1
Reporter: Glen Hilton
The bug actually should be found by existing test cases in ConstraintValidatorContextTest, but there happens to be a bug there too.
First to the test case bug:
In ConstraintValidatorContextTest, within the testing utility method assertMessageAndPath there's a call to TestUtil.assertEqualPaths. TestUtil.assertEqualPaths doesn't assert anything it returns a boolean, this fact causes line 156:
{{assertEqualPaths( messageAndPath.getPath(), PathImpl.createPathFromString( expectedPath ) );}}
to not actually test anything. Given this testing bug, we don't know that ConstraintValidatorContextTest.testMultipleMessages line 144:
{{assertMessageAndPath( messageAndPathList.get( 1 ), message2, "" );}}
should actually fail. As a quick and dirty fix to the test cases, we could wrap the existing line 144 with assertTrue, so it would end up:
{{assertTrue(assertMessageAndPath( messageAndPathList.get( 1 ), message2, "" ))}}
Now two of the tests in ConstraintValidatorContextTest will fail.
These test cases appear to fail because within ConstraintValidatorContextImpl, all of the subclasses (ErrorBuilderImpl, NodeBuilderImpl, InIterableNodeBuilderImpl) are getting instantiated with a reference to the propertyPath at the "base" level (ConstraintValidatorContextImpl.propertyPath). Meaning when the subclasses update the propertyPath they are actually all updating the same underlying object, leading to incorrect paths being created.
This bug appears to have been introduced with HV-395 as before there was code to create a copy of the path when ErrorBuilderImpl.addNode was called. Sorry I don't have an actual fix to provide, as I don't fully grasp HV-395. p.s. thanks for all the hard work!
--
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
[Hibernate-JIRA] Created: (HHH-3008) Cascade delete does not work with unidirectional @OneToMany and @JoinTable
by Daniel Dyer (JIRA)
Cascade delete does not work with unidirectional @OneToMany and @JoinTable
--------------------------------------------------------------------------
Key: HHH-3008
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3008
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.5
Environment: Standalone entity manager (JavaSE 5.0).
H2 database.
Reporter: Daniel Dyer
A unidirectional one-to-many relationship defined as follows:
public class Owner
{
@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "owner_element",
joinColumns = @JoinColumn(name = "owner_id",
nullable = false,
updatable = false),
inverseJoinColumns = @JoinColumn(name = "element_id",
nullable = false,
updatable = false))
private List<Element> elements;
// ...
}
Attempting to delete an instance of Owner should also delete all associated instances of Element. Instead I get the following error:
SEVERE: Referential integrity constraint violation: FK56BBF9C487E817D: PUBLIC.OWNER_ELEMENT FOREIGN KEY(OWNER_ID) REFERENCES PUBLIC.OWNER(ID) [23003-63]
This is because Hibernate attempts to delete the Owner row without first removing the rows from the join table.
--
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
[Hibernate-JIRA] Created: (HSEARCH-623) Support for faceting search results
by G Fernandes (JIRA)
Support for faceting search results
-----------------------------------
Key: HSEARCH-623
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-623
Project: Hibernate Search
Issue Type: New Feature
Components: engine
Reporter: G Fernandes
I've been asked more than once about the possibility to support facet retrieval from the search results. The idea is to categorize the results of a query into buckets containing a label plus a number of occurrences. Consider an example: I have a Book entity containing a language field. When I search for Books, I'd like to obtain not only a List<Book>, but also a list of languages and how many books from the search results fit into each of these languages, so that I can render the results as:
Found 17 Books:
English (10)
Italian (5)
Spanish (2)
It'd be also possible to facet on more than a field at the same time, similar to what's being done with projections.
Facet calculation would be done at query time reading directly from the index, probably by using a plugable strategy, examples would be LuceneFieldCacheStrategy and TermEnumStrategy.
Asking for facets would be done at API level, probably with a decorator on top of QueryBuilder something like
facetQueryBuilder.facetOn("field1").facetOn("field2").results().facets();
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
15 years