[Hibernate-JIRA] Commented: (HHH-1639) Add Events to Query methods
by Wells Tiedeman (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1639?page=c... ]
Wells Tiedeman commented on HHH-1639:
-------------------------------------
Touche. We used an aspect on the Criteria query methods since a hook wasn't provided. For example:
pointcut criteriaListExecution(Criteria targetCriteria) : target(targetCriteria) &&
call(List Criteria.list()) && !this(RowSecurityGuard) && !within(RowSecurityAspect);
List around(Criteria targetCriteria) : criteriaListExecution(targetCriteria)
{
log.debug("\n\nEntering aspect criteriaListExecution.\n\n");
this.adviseQuery(targetCriteria);
List result = proceed(targetCriteria);
log.debug("\n\nLeaving aspect criteriaListExecution.\n\n");
return result;
}
> Add Events to Query methods
> ---------------------------
>
> Key: HHH-1639
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1639
> Project: Hibernate3
> Issue Type: New Feature
> Components: core
> Affects Versions: 3.1.3
> Reporter: jose
> Priority: Minor
> Original Estimate: 2 days
> Remaining Estimate: 2 days
>
> Current event methods capturing some persistence actions (on session actions) but not capturing persistence-searchs actions (on Query object)
>
> I would like adds event architecture to Query, adding listeners to iterate, list, scroll,... methods to allows customizable "pre" and "post" actions over list searchs
--
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
17 years, 8 months
[Hibernate-JIRA] Updated: (HHH-1039) WrongClassException when scrolling through EntityMode.DOM4J and loading identical objects from different fields
by jason (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1039?page=c... ]
jason updated HHH-1039:
-----------------------
Attachment: Loader.java
Here is a fix, basically in the org\hibernate\loader\Loader.java class in the getRow(....) method we catch the WrongClassException thrown by the instanceAlreadyLoaded(....) method and call instanceNotYetLoaded(...) to fetch the desired data 'fresh'. FYI this was done on version 3.1
> WrongClassException when scrolling through EntityMode.DOM4J and loading identical objects from different fields
> ---------------------------------------------------------------------------------------------------------------
>
> Key: HHH-1039
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1039
> Project: Hibernate3
> Issue Type: Bug
> Affects Versions: 3.0.5
> Environment: Windows XP, JDK 1.4.2_8, Hibernate 3.0.5, Oracle 9.2. Replicated on Windows XP, JDK 1.5.0_2, Hibernate 3.0.5, MySQL
> Reporter: Roland Groen
> Fix For: entity-modes
>
> Attachments: HbmXmlTest.java, Loader.java, Test.hbm.xml
>
>
> When working with XML representations of entities, an unexpected org.hibernate.WrongClassException is thrown when working with identical embedded objects (embed-xml="true") which have different field names.
> org.hibernate.WrongClassException seems to be thrown when:
> 1) Running in EntityMode.DOM4J
> 2) Scrolling through a result set using session.scroll()
> 3) Embedding objects that are:
> a) Referred by least by one of the objects on which the query is selecting primarily (parent object) and,
> b) that field is in FetchMode.JOIN.
> c) Referred by one object which is embedded (embed-xml="true") and uses a different field name to refer to the object than the parent object.
> I would like to apologise for the large test case. The bug is quite hard to reproduce, I tried to minimise the test, but this seems the smallest and most simple case I can find.
> The stack trace is:
> Caused by: org.hibernate.WrongClassException: Object with id: 1 was not of the specified subclass: Customer (loaded object was of wrong class)
> at org.hibernate.loader.Loader.instanceAlreadyLoaded(Loader.java:890)
> at org.hibernate.loader.Loader.getRow(Loader.java:846)
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:305)
> at org.hibernate.loader.Loader.loadSingleRow(Loader.java:238)
> at org.hibernate.impl.ScrollableResultsImpl.prepareCurrentRow(ScrollableResultsImpl.java:477)
> at org.hibernate.impl.ScrollableResultsImpl.next(ScrollableResultsImpl.java:106)
> at HbxXmlTest.main(HbxXmlTest.java:90)
> The included files are:
> Test.hbm.xml : the hbm file to create the classes
> HbmXmlTest.java : the the java source to reproduce the issue.
> Greetings,
> Roland.
--
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
17 years, 8 months
[Hibernate-JIRA] Created: (HBX-937) warn users if using default templates, rather than templates (not) found in templatepath
by Donall Osuilleabhain (JIRA)
warn users if using default templates, rather than templates (not) found in templatepath
----------------------------------------------------------------------------------------
Key: HBX-937
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-937
Project: Hibernate Tools
Issue Type: Improvement
Components: ant, hbm2java
Affects Versions: 3.2beta9
Environment: hibernate tools 3.2 beta 9, ant, freemarker templates
Reporter: Donall Osuilleabhain
Priority: Minor
Further to JIRA issues HBX-382 and HBX-383, may i suggest that when the hbm2java exporter does not find templates in the directory specified in attribute "templatepath", a warning is outputted to the user to the effect that "No templates were found in the specified tempaltepath: <templatepath-value>, using default templates.", before the exporter proceeds to use the default templates it finds somewhere else.
Not for nothing, the warning could also say that the exporter expects to find the template within a sub-directory called "pojo", and to be called Pojo.ftl, because IMHO this is not evident from the documentation available.
--
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
17 years, 8 months