[hibernate-commits] [hibernate/hibernate-core] 64b73d: HHH-3646 - implement a test case for query collect...

noreply at github.com noreply at github.com
Wed Mar 30 13:32:20 EDT 2011


Branch: refs/heads/master
Home:   https://github.com/hibernate/hibernate-core

Commit: 64b73d630159793346d6d7994f556cba1617a044
    https://github.com/hibernate/hibernate-core/commit/64b73d630159793346d6d7994f556cba1617a044
Author: David Mansfield <david at gandalf.cobite.com>
Date:   2011-03-30 (Wed, 30 Mar 2011)

Changed paths:
  M hibernate-core/src/test/java/org/hibernate/test/criteria/Course.java
  M hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java
  M hibernate-core/src/test/java/org/hibernate/test/criteria/Enrolment.hbm.xml

Log Message:
-----------
HHH-3646 - implement a test case for query collection-of-value


Commit: b8230bd07dfdf6e9042e3628b81e8e507f1bcfbe
    https://github.com/hibernate/hibernate-core/commit/b8230bd07dfdf6e9042e3628b81e8e507f1bcfbe
Author: David Mansfield <david at gandalf.cobite.com>
Date:   2011-03-30 (Wed, 30 Mar 2011)

Changed paths:
  M hibernate-core/src/test/java/org/hibernate/test/criteria/CriteriaQueryTest.java
  M hibernate-core/src/test/java/org/hibernate/test/criteria/Enrolment.hbm.xml
  M hibernate-core/src/test/java/org/hibernate/test/criteria/Student.java
  A hibernate-core/src/test/java/org/hibernate/test/criteria/StudentAddress.java

Log Message:
-----------
HHH-3646 - implement a test case for query collection-of-component


Commit: 4ddaaa1deb9d724d5dedd6fb4637d1c3e4b85670
    https://github.com/hibernate/hibernate-core/commit/4ddaaa1deb9d724d5dedd6fb4637d1c3e4b85670
Author: David Mansfield <david at gandalf.cobite.com>
Date:   2011-03-30 (Wed, 30 Mar 2011)

Changed paths:
  M hibernate-core/src/main/java/org/hibernate/hql/ast/util/SessionFactoryHelper.java

Log Message:
-----------
HHH-3646 - make SessionFactoryHelper::getCollectionPropertyMapping public - it will be used later


Commit: 9f311a469863c79f544efb9fbfa6cd3d1f94f989
    https://github.com/hibernate/hibernate-core/commit/9f311a469863c79f544efb9fbfa6cd3d1f94f989
Author: David Mansfield <david at gandalf.cobite.com>
Date:   2011-03-30 (Wed, 30 Mar 2011)

Changed paths:
  A hibernate-core/src/main/java/org/hibernate/loader/criteria/ComponentCollectionCriteriaInfoProvider.java
  A hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaInfoProvider.java
  M hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaJoinWalker.java
  M hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java
  A hibernate-core/src/main/java/org/hibernate/loader/criteria/EntityCriteriaInfoProvider.java
  A hibernate-core/src/main/java/org/hibernate/loader/criteria/ScalarCollectionCriteriaInfoProvider.java

Log Message:
-----------
HHH-3646 - implement Criteria API querying of collection-of-component and collection-of-scalar

The general approach is:

* create an interface called the CriteriaInfoProvider which abstracts
  the operations that are different for the different types of Criteria
  targets.
* change the getPathEntityName method to be a factory method for
  creating the proper implementation of the interface
* change the rest of CriteriaQueryTranslator to use the interface
  instead of using the previous entity-only implementation
* implementations of the interface exist for
  Entity: this implements the same code as currently exists
  ComponentCollection: for collection-of-component
  ScalarCollection: for collection-of-value
  Component: for components
* update the logic in CriteriaJoinWalker which has to be very careful
  about how it works since the walker walks certain property paths twice.


Commit: 69b09dfcd235ff2374fb7a02070f7edaf246f2a3
    https://github.com/hibernate/hibernate-core/commit/69b09dfcd235ff2374fb7a02070f7edaf246f2a3
Author: David Mansfield <david at gandalf.cobite.com>
Date:   2011-03-30 (Wed, 30 Mar 2011)

Changed paths:
  M hibernate-core/src/main/java/org/hibernate/loader/JoinWalker.java

Log Message:
-----------
HHH-3646 - don't append spurious comma in SQL select fragment

In the JoinWalker, we assemble an SQL select list fragment
from a list of Joinables. In the existing code, we see it's
possible for the selectFragment generated by a joinable to be empty.
However if the LAST joinable generates an empty fragment, we put
a spurious comma into the fragment. Fix this by only prepending a
comma when necessary.


Commit: 90fdca9053d1d0f7d14e2c7b20c243ca62d07305
    https://github.com/hibernate/hibernate-core/commit/90fdca9053d1d0f7d14e2c7b20c243ca62d07305
Author: David Mansfield <david at gandalf.cobite.com>
Date:   2011-03-30 (Wed, 30 Mar 2011)

Changed paths:
  M documentation/src/main/docbook/manual/en-US/content/query_criteria.xml
  M hibernate-core/src/main/java/org/hibernate/loader/criteria/CriteriaQueryTranslator.java

Log Message:
-----------
HHH-3646 - throw a better exception when criteria is placed directly on component

In the CriteriaQueryTranslator, we process the path given by
a SubCriteria object looking for the entity name for the property. If
the SubCriteria was mistakenly created on a component type, we will exit
the loop using the owning entity, and will eventually end up failing
(throwing an exception) trying to lookup up the restricted property
against the entity, instead of against the component. Fix this by
throwing a more informative exception, and modify the documentation to
be explicit about how to do this properly.


Commit: 5b5ec673b4ca35ea271a62890a18974242ca8aa5
    https://github.com/hibernate/hibernate-core/commit/5b5ec673b4ca35ea271a62890a18974242ca8aa5
Author: David Mansfield <david at gandalf.cobite.com>
Date:   2011-03-30 (Wed, 30 Mar 2011)

Changed paths:
  M documentation/src/main/docbook/manual/en-US/content/query_criteria.xml

Log Message:
-----------
HHH-3646 - documentation for Criteria query of collection-of-component and collection-of-scalar functionality


Compare: https://github.com/hibernate/hibernate-core/compare/e0431ad...5b5ec67


More information about the hibernate-commits mailing list