[Hibernate-JIRA] Created: (HHH-2629) Enable ordering by association paths
by Jörg Heinicke (JIRA)
Enable ordering by association paths
------------------------------------
Key: HHH-2629
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2629
Project: Hibernate3
Issue Type: Patch
Components: query-criteria
Affects Versions: 3.2.4.sp1
Reporter: Jörg Heinicke
In Hibernate's criteria API ordering is not possible on association properties without explicitly creating aliases.
This also only works on one level, not recursively as it would be needed in the following example.
Criteria criteria = session.createCriteria(Account.class);
Criteria pCriteria = criteria.createCriteria("person");
pCriteria.add(Example.create(person));
pCriteria.createCriteria("company");
criteria.addOrder(Order.asc("person.company.name"));
return criteria.list();
I have changed CriteriaQueryTranslator in a way that it first searches the aliasCriteriaMap, second the associationPathCriteriaMap. And the key used for the search is no longer
StringHelper.root( propertyName );
but
StringHelper.qualifier( propertyName );
>From what I understand this can't break anything since it has always only worked with one '.' in the path. For those cases the key stays the same.
This implementation is still not perfect since
1. you need to create criteria in advance
2. you can't switch between alias and actual association path. The best would probably be to walk the path recursively.
--
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
16 years, 9 months
[Hibernate-JIRA] Created: (HBX-1038) NullPointerException trying to open "hibernate.reveng.xml" in Hibernate Reverse Engineering Editor
by Alex K (JIRA)
NullPointerException trying to open "hibernate.reveng.xml" in Hibernate Reverse Engineering Editor
--------------------------------------------------------------------------------------------------
Key: HBX-1038
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1038
Project: Hibernate Tools
Issue Type: Bug
Components: reverse-engineer
Affects Versions: 3.2.0.GA
Environment: Windows XP, Eclipse 3.3.1.1.
Reporter: Alex K
I am getting an excepting trying to open "hibernate.reveng.xml" in Hibernate Reverse Engineering Editor.
Tools are 3.2.0 GA. Eclipse is 3.3.1.1.
Stack trace:
java.lang.NullPointerException
at org.eclipse.wst.sse.ui.StructuredTextEditor.update(StructuredTextEditor.java:3096)
at org.hibernate.eclipse.mapper.editors.xpl.XMLFormEditorPart.addSourcePage(XMLFormEditorPart.java:185)
at org.hibernate.eclipse.mapper.editors.xpl.XMLFormEditorPart.addPages(XMLFormEditorPart.java:50)
at org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor.addPages(ReverseEngineeringEditor.java:84)
at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:146)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:283)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:426)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:263)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2739)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2651)
at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPage.java:2643)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2595)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2590)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2574)
at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:340)
at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.java:328)
at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMenu.java:190)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
hibernate.reveng.xml has been generated by the Reverse Engineering Wizard. Contents are (about 9 tables are referenced):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering>
<table-filter match-catalog="mysql" match-name="table1"/>
<table-filter match-catalog="mysql" match-name="table2"/>
...
</hibernate-reverse-engineering>
--
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
16 years, 9 months
[Hibernate-JIRA] Created: (HHH-3197) subquery is not valid SQL when select type is same as parent sql select type
by Nicolai Marck Ødum (JIRA)
subquery is not valid SQL when select type is same as parent sql select type
----------------------------------------------------------------------------
Key: HHH-3197
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3197
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.6
Environment: Java 1.5.0_14
JBoss 4.2.2.GA (Hibernate 3.2.1) - I have also tried with Hibernate 3.2.6.ga, hibernate-annotations-3.3.1.GA and hibernate-entitymanager-3.3.2.GA with same result.
PostgreSQL 8.3.0
WindowsXP
Reporter: Nicolai Marck Ødum
The following ejb3 QL:
"Delete FROM Notification noti WHERE noti NOT IN (SELECT subNoti.notifications FROM SubscriberNotification subNoti)"
Result in the following sql
"delete from Notification where id not in (select . from SubscriberNotification subscriber1_, SubscriberNotification_Notification notificati2_, Notification notificati3_ where subscriber1_.id=notificati2_.SubscriberNotification_id and notificati2_.notifications_id=notificati3_.id)"
notice the "select . from" in the subquery
if I alter the sql to be
"delete from Notification where id not in (select notificati3_.id from SubscriberNotification subscriber1_, SubscriberNotification_Notification notificati2_, Notification notificati3_ where subscriber1_.id=notificati2_.SubscriberNotification_id and notificati2_.notifications_id=notificati3_.id)"
I have not been able to create a workaround.
--
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
16 years, 9 months
[Hibernate-JIRA] Created: (ANN-636) Add the annotations to map the User Collection Type
by jason (JIRA)
Add the annotations to map the User Collection Type
---------------------------------------------------
Key: ANN-636
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-636
Project: Hibernate Annotations
Issue Type: New Feature
Components: binder
Environment: n/a
Reporter: jason
I am searching a way from the Hibernate Annotation to map the user defined collection, and find out the following :
Can anybody let me know what the status for this? or how i can map the user collection type by hibernate annotation, thanks
Add an annotation to specify the UserCollectionType for a OneToMany or ManyToMany.
The annotation is named CollectionTypeInfo, perhaps better named UserCollectionType, but I didn't know the standards for naming classes.
The change to AnnotationBinder is minor and is delineated by '//dwsjoquist//' comment lines.
Usage:
@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "id")
@CollectionTypeInfo(name = "examples.MyUserCollectionType")
public List<ExampleAttribute> getExampleAttributes() {
--
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
16 years, 9 months
[Hibernate-JIRA] Created: (HHH-3365) SchemaUpdate still fails if conflicting table is visible in another user's tablespace
by John Wood (JIRA)
SchemaUpdate still fails if conflicting table is visible in another user's tablespace
-------------------------------------------------------------------------------------
Key: HHH-3365
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3365
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.3.0.CR1, 3.2.6, 3.1
Reporter: John Wood
Priority: Minor
This issue is a duplicate of HHH-2208. Despite what that other issue states, this doesn't seem to be fixed.
This issue still seems to a problem for us when using the SchemaUpdate tool to auto-update our tables (in Oracle).
We've tried this using the following hibernate versions: 3.1, 3.2.6ga, 3.3.0.CR1
In every case the bug still happens: the schema update tool tries to update a table called "JOB", finds a table in someone else's schema (which happens to have been made public), and then gets confused. It will either try to update the other user's JOB table, or (in our case), fails because it (quite rightly) doesn't have permissions to change the other user's table.
Here is how to reproduce:
1) Create your main DB user as normal (user1)
2) Create another user on the Oracle same database (user2)
3) On user2 create a new table which conflicts with a table in your generated DB ("job").
4) Make this new table visible to user1. One way of doing this is to give "insert" privildeges to "public":
grant insert on user2.job to public
5) Run the schema update tool for user1. This will fail: it tries to update the table in user2's schema (tablespace), and doesn't have permissions.
Note that this issue only occurs when the conflicting table is visible to user1: if the table was hidden (i.e. user1 had no visibility of the conflicting table), we would be OK.
It seems to me that either A) there is some confusion about when this issue was fixed, or B) this is a different issue to HHH-2208
--
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
16 years, 9 months