[Hibernate-JIRA] Created: (HHH-3808) Manual fetching of associations
by Ovidio Mallo (JIRA)
Manual fetching of associations
-------------------------------
Key: HHH-3808
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3808
Project: Hibernate Core
Issue Type: New Feature
Components: core
Reporter: Ovidio Mallo
In performance critical parts of an application, batch fetching and subselect fetching not always allow for an efficient and specific prefetching of entity associations. Therefore, I wanted to propose to add some API which allows to prefetch a given association for a user defined set of entities. This could be something like
Session#fetch(Class ownerClass, Serializable[] ownerIds, String propertyName)
or
Session#fetch(Class ownerClass, Object[] owners, String propertyName)
or something similar. The method would then load the association for the given entities (just like batch fetching would do) and put the associations in the session cache for later usage.
I think this would greatly help when performance really matters and you want to have full control about the set of entities on which an association is fetched.
--
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, 9 months
[Hibernate-JIRA] Commented: (HHH-1829) Allow join on any property using property-ref
by Nancy Bosecker (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1829?page=c... ]
Nancy Bosecker commented on HHH-1829:
-------------------------------------
This issue is still major for our legacy-schema mappings.
There appears to be a fix but it's not incorporated into a Hibernate build for some reason. Will this ever happen??
Should we all just stop waiting?? As noted above, it's been 2 years with no solution.
> 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: Steve Ebersole
> 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
15 years, 9 months
[Hibernate-JIRA] Created: (HV-128) Support Iterable
by Emmanuel Bernard (JIRA)
Support Iterable
----------------
Key: HV-128
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-128
Project: Hibernate Validator
Issue Type: Improvement
Components: engine
Affects Versions: 4.0.0.Alpha2
Reporter: Emmanuel Bernard
Assignee: Hardy Ferentschik
Fix For: 4.0.0.Alpha3
I tried to implement it myself but several part of the code held me off.
It seems ReflectionHelper is fairly buggy.
The idea was to convert isCollection, getCollectionClass, isCollectionClass to isIterable, getIterableClass, isIterableClass. It is straightforward except that in various places, the code expect Map to be a subclass of Collection which it is *not*:
ReflectionHelper.getIndexedType assumes so
ReflectionHelper.getIndexedValue assumes so
I suspect Map is not tested.
Also the code seems to consider every Collection as indexed (but I might be wrong)
--
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, 9 months
[Hibernate-JIRA] Commented: (HHH-1280) Cascade refresh and new instances
by Alexey Shakov (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1280?page=c... ]
Alexey Shakov commented on HHH-1280:
------------------------------------
Hi,
another solution (using RefreshEventListener):
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
import org.hibernate.event.RefreshEvent;
import org.hibernate.event.def.DefaultRefreshEventListener;
@SuppressWarnings("serial")
public class RefreshListener extends DefaultRefreshEventListener {
private static final Log log = LogFactory.getLog(RefreshListener.class);
@SuppressWarnings("unchecked")
@Override
/**
* This implementation throws no exception, if non-persistent object is refreshed
*/
public void onRefresh(RefreshEvent event, Map refreshedAlready) throws HibernateException {
if (event.getSession().contains(event.getObject())) super.onRefresh(event, refreshedAlready);
else log.info("Object " + event.getObject() + " was probably not persisted yet");
}
}
SessionFactory configuraton (Spring):
<property name="eventListeners">
<map>
<entry key="refresh"><bean class="...RefreshListener" /></entry>
</map>
</property>
> Cascade refresh and new instances
> ---------------------------------
>
> Key: HHH-1280
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1280
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Reporter: Gavin King
> Attachments: Fix.zip, patch.zip
>
>
> I have a report that if you have a managed object, with a reference to a new object, where cascade refresh is enabled, and you refresh the managed object, then you will get an exception as refresh tries to cascade to the new object. In fact, the new object should just be ignored.
> Looking at the code, this does appear to be the case.
--
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, 9 months
[Hibernate-JIRA] Commented: (HHH-1283) ScrollableResults JoinFetch don't set child collection correctly after the second parent object
by Larry Chu (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1283?page=c... ]
Larry Chu commented on HHH-1283:
--------------------------------
HH-1751 was marked duplicate and contains a patch. I don't know if it works. Dependant bug HH-1803 contains additional information and a patch as well.
> ScrollableResults JoinFetch don't set child collection correctly after the second parent object
> -----------------------------------------------------------------------------------------------
>
> Key: HHH-1283
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1283
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1
> Environment: Hibernate 3.1
> Oracle10gR2
> Oracle JDBC Driver 10.2.0.1.0
> Sun JDK 1.5.0_06
> Spring 1.2.6
> Reporter: Masahiro Hirashima
> Attachments: ScrollableCollectionFetchingTest.java, ScrollableResults.zip
>
>
> ScrollableResults JoinFetch set child collection correctly at first parent object.
> but after the second parent object, It set only the first element of a child collection.
> I made the following tables.
> CREATE TABLE owners (
> id NUMBER(36, 0) NOT NULL PRIMARY KEY,
> first_name VARCHAR(30),
> last_name VARCHAR(30),
> address VARCHAR(255),
> city VARCHAR(80),
> telephone VARCHAR(20),
> version NUMBER(36, 0) DEFAULT 0
> );
> CREATE TABLE types (
> id NUMBER(36, 0) NOT NULL PRIMARY KEY,
> name VARCHAR(80),
> version NUMBER(36, 0) DEFAULT 0
> );
> CREATE TABLE pets (
> id NUMBER(36, 0) NOT NULL PRIMARY KEY,
> name VARCHAR(30),
> birth_date DATE,
> type_id NUMBER(36, 0),
> owner_id NUMBER(36, 0),
> version NUMBER(36, 0) DEFAULT 0
> );
> and inserted the following data.
> INSERT INTO owners VALUES (1, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749', 0);
> INSERT INTO owners VALUES (2, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763', 0);
> INSERT INTO pets VALUES (1, 'Leo', '2000-09-07', 1, 1, 0);
> INSERT INTO pets VALUES (2, 'Basil', '2002-08-06', 2, 1, 0);
> INSERT INTO pets VALUES (3, 'Rosy', '2001-04-17', 3, 2, 0);
> INSERT INTO pets VALUES (4, 'Jewel', '2000-03-07', 4, 2, 0);
> INSERT INTO pets VALUES (5, 'Iggy', '2000-11-30', 5, 2, 0);
> INSERT INTO types VALUES (1, 'cat', 0);
> INSERT INTO types VALUES (2, 'dog', 0);
> INSERT INTO types VALUES (3, 'lizard', 0);
> INSERT INTO types VALUES (4, 'snake', 0);
> INSERT INTO types VALUES (5, 'bird', 0);
> and I execute following code.
> String hqlJoinFetchTest =
> "from Owner owner " +
> "left outer join fetch owner.pets as pets " +
> "left outer join fetch pets.type " +
> "order by owner.firstName, owner.lastName";
> Query query = session.createQuery(hqlJoinFetchTest);
> ScrollableResults cursor = query.scroll();
> while ( cursor.next() ) {
> Owner owner = (Owner)cursor.get(0);
> System.out.println(owner);
> }
> result of this code is following.
> petclinic.domain.Owner@15d616e[id=1,version=0,firstName=Betty,lastName=Davis,
> petclinic.domain.Pet@136d9d8[id=2,version=0,name=Basil,birthDate=2002-08-06,
> petclinic.domain.PetType@1be2893[id=2,version=0,name=dog]
> petclinic.domain.Pet@14a75bb[id=1,version=0,name=Leo,birthDate=2000-09-07,
> petclinic.domain.PetType@17779e3[id=1,version=0,name=cat]
> petclinic.domain.Owner@e3570c[id=2,version=0,firstName=Eduardo,lastName=Rodriquez
> petclinic.domain.Pet@167e3a5[id=4,version=0,name=Jewel,birthDate=2000-03-07,
> petclinic.domain.PetType@1926e90[id=4,version=0,name=snake]
> First owner object set collection collectly.
> but second owner object don't set second pet object(id=5) and third pet object(id=6).
--
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: (HHH-3531) Constraint violation Error
by suman (JIRA)
Constraint violation Error
--------------------------
Key: HHH-3531
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3531
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: Spring/Hibernate/Mysql/
Reporter: suman
Hello All,
I am Using Spring with Hibernate in my web application.I got Syncronize Exception in some Cases.Atually i am updating to table(sno[PK,Auto increment],acno,pan)
In my HBM file i am mentioning sno as increment of generator class.Keen obeservation i am not getting this sort of problem always.In some Time i got this sort of proble,
Log as follows:
INFO | jvm 2 | 2008/10/15 16:06:25 | 16:06:25,353 WARN JDBCExceptionReporter:71 - SQL Error: 1062, SQLState: 23000
INFO | jvm 2 | 2008/10/15 16:06:25 | 16:06:25,354 ERROR JDBCExceptionReporter:72 - Duplicate key or integrity constraint violation, message from server: "Duplicate entry '984041' for key 1"
INFO | jvm 2 | 2008/10/15 16:06:25 | 16:06:25,355 ERROR AbstractFlushingEventListener:277 - Could not synchronize database state with session
INFO | jvm 2 | 2008/10/15 16:06:25 | org.hibernate.exception.ConstraintViolationException: could not insert: [com.xxx.model.map]
--
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] Commented: (HHH-1283) ScrollableResults JoinFetch don't set child collection correctly after the second parent object
by David J. M. Karlsen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1283?page=c... ]
David J. M. Karlsen commented on HHH-1283:
------------------------------------------
Same here.
This will not give unique results:
ScrollableResults scrollableResults = session.createCriteria( Tpwpamsg.class )
.setResultTransformer( CriteriaSpecification.DISTINCT_ROOT_ENTITY )
.add( Restrictions.eq( "fileId", fileId ) )
.setFetchMode( "tpwpmsgrs", FetchMode.JOIN )
.setFetchMode( "tpwpmsges", FetchMode.JOIN )
.scroll( );
Hibernate 3.1.1 or older.
same with a query and scrollable result
Any news on this - it's an very old issue?
> ScrollableResults JoinFetch don't set child collection correctly after the second parent object
> -----------------------------------------------------------------------------------------------
>
> Key: HHH-1283
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1283
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1
> Environment: Hibernate 3.1
> Oracle10gR2
> Oracle JDBC Driver 10.2.0.1.0
> Sun JDK 1.5.0_06
> Spring 1.2.6
> Reporter: Masahiro Hirashima
> Attachments: ScrollableCollectionFetchingTest.java, ScrollableResults.zip
>
>
> ScrollableResults JoinFetch set child collection correctly at first parent object.
> but after the second parent object, It set only the first element of a child collection.
> I made the following tables.
> CREATE TABLE owners (
> id NUMBER(36, 0) NOT NULL PRIMARY KEY,
> first_name VARCHAR(30),
> last_name VARCHAR(30),
> address VARCHAR(255),
> city VARCHAR(80),
> telephone VARCHAR(20),
> version NUMBER(36, 0) DEFAULT 0
> );
> CREATE TABLE types (
> id NUMBER(36, 0) NOT NULL PRIMARY KEY,
> name VARCHAR(80),
> version NUMBER(36, 0) DEFAULT 0
> );
> CREATE TABLE pets (
> id NUMBER(36, 0) NOT NULL PRIMARY KEY,
> name VARCHAR(30),
> birth_date DATE,
> type_id NUMBER(36, 0),
> owner_id NUMBER(36, 0),
> version NUMBER(36, 0) DEFAULT 0
> );
> and inserted the following data.
> INSERT INTO owners VALUES (1, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749', 0);
> INSERT INTO owners VALUES (2, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763', 0);
> INSERT INTO pets VALUES (1, 'Leo', '2000-09-07', 1, 1, 0);
> INSERT INTO pets VALUES (2, 'Basil', '2002-08-06', 2, 1, 0);
> INSERT INTO pets VALUES (3, 'Rosy', '2001-04-17', 3, 2, 0);
> INSERT INTO pets VALUES (4, 'Jewel', '2000-03-07', 4, 2, 0);
> INSERT INTO pets VALUES (5, 'Iggy', '2000-11-30', 5, 2, 0);
> INSERT INTO types VALUES (1, 'cat', 0);
> INSERT INTO types VALUES (2, 'dog', 0);
> INSERT INTO types VALUES (3, 'lizard', 0);
> INSERT INTO types VALUES (4, 'snake', 0);
> INSERT INTO types VALUES (5, 'bird', 0);
> and I execute following code.
> String hqlJoinFetchTest =
> "from Owner owner " +
> "left outer join fetch owner.pets as pets " +
> "left outer join fetch pets.type " +
> "order by owner.firstName, owner.lastName";
> Query query = session.createQuery(hqlJoinFetchTest);
> ScrollableResults cursor = query.scroll();
> while ( cursor.next() ) {
> Owner owner = (Owner)cursor.get(0);
> System.out.println(owner);
> }
> result of this code is following.
> petclinic.domain.Owner@15d616e[id=1,version=0,firstName=Betty,lastName=Davis,
> petclinic.domain.Pet@136d9d8[id=2,version=0,name=Basil,birthDate=2002-08-06,
> petclinic.domain.PetType@1be2893[id=2,version=0,name=dog]
> petclinic.domain.Pet@14a75bb[id=1,version=0,name=Leo,birthDate=2000-09-07,
> petclinic.domain.PetType@17779e3[id=1,version=0,name=cat]
> petclinic.domain.Owner@e3570c[id=2,version=0,firstName=Eduardo,lastName=Rodriquez
> petclinic.domain.Pet@167e3a5[id=4,version=0,name=Jewel,birthDate=2000-03-07,
> petclinic.domain.PetType@1926e90[id=4,version=0,name=snake]
> First owner object set collection collectly.
> but second owner object don't set second pet object(id=5) and third pet object(id=6).
--
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: (HHH-3774) java.lang.NoClassDefFoundError: net/sf/cglib/core/Predicate with hibernate 3.3.1
by Sabitha Gopal pandit (JIRA)
java.lang.NoClassDefFoundError: net/sf/cglib/core/Predicate with hibernate 3.3.1
--------------------------------------------------------------------------------
Key: HHH-3774
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3774
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Reporter: Sabitha Gopal pandit
Priority: Critical
i upgraded to hibernate 3.3.1 and get the following exception
this is show stopper for my current work
java.lang.NoClassDefFoundError: net/sf/cglib/core/Predicate at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at org.ddsteps.dataset.excel.ExcelDataTableAdapter.headerCellsIterator(ExcelDataTableAdapter.java:262) at org.ddsteps.dataset.excel.ExcelDataRowAdapter.iterator(ExcelDataRowAdapter.java:122) at org.ddsteps.dataset.decorator.DataRowDecorator.iterator(DataRowDecorator.java:57) at org.ddsteps.junit.behaviour.DdRowBehaviour.setUpData(DdRowBehaviour.java:181) at org.ddsteps.junit.behaviour.DdRowBehaviour.setUp(DdRowBehaviour.java:110) at org.ddsteps.DDStepsTestCase.setUp(DDStepsTestCase.java:123) at org.ddsteps.DDStepsTestCase.run(DDStepsTestCase.java:113) at org.ddsteps.junit.behaviour.DdMethodBehaviour.run(DdMethodBehaviour.java:102) at org.ddsteps.DDStepsTestCase.run(DDStepsTestCase.java:112)
--
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