James Sutherland wrote:I think the reason the spec does not allow the aliasing of join fetches, is that if you join fetch something, the same alias should not be used in the where clause, as it could result in returning corrupt objects.
i.e. in your example if the User had several groups, some of which had id=123 and another had id=456, then your join fetch query will only bring back the one with 123. This will mean the JPA provider will build and return User 'John' with only a single group 123, even though 'John' should have 2 groups, this is invalid data.
To correct this in JPA you must use a normal join in conjunction with the fetch join,
i.e.
This will return the correct result.
If you really only want the one User and one Group back, then you should just query both, without the join fetch,
i.e.
Section Summary:
General Con: 100 100
Documentation: 70 70
OOD: 30 30
GUI: 40 16
Locking: 80 80
Data Store: 40 20
Network Server: 40 40
Total: 400 366
java.lang.ArrayIndexOutOfBoundsException: 6 >= 1
at java.util.Vector.elementAt(Unknown Source)
at javax.swing.table.DefaultTableColumnModel.getColumn(Unknown Source)
at suncertify.client.RoomsTableColumnModel.getColumn(RoomsTableColumnModel.java:48)
at javax.swing.plaf.basic.BasicTableUI.paintCells(Unknown Source)
at javax.swing.plaf.basic.BasicTableUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown Source)
at javax.swing.JComponent.paintDoubleBuffered(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.
On balance I think method 1 is the better solution in this case. Others may disagree.
Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file.