Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!

Flavio Nobili

Ranch Hand
+ Follow
since Jan 28, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Flavio Nobili

While it's a many-to-many relationship, it gives me a cartesian product result. I would like to get an user object populated with its groups only.
If I use this query without 'fetch' (in lazy mode), when I access the object all groups are loaded.

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,


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'm trying to execute this code using EclipseLink but it wont work. It complains about the alias 'g'. When I use Hibernate provider it works. Does anyone know what is the problem with this code?

syntax error at [g].


Does anyone know if Oracle works well with virtualization in Linux? Are there any instability problem?

10 years ago
There is another book: "Enterprise JavaBeans 3.0 (5th Edition)". Does anyone can say which book is better to study for the new certification exam?

Congratulations Cleuton! Great score!!!
Lots of �Portals� will open to you now.

Now it�s my turn! And I�ll be happy if I get enough to pass.
Thanks in advance for the advices on which steps to take.

Fl�vio Nobili
Is there any way of saying to the container that I want a "lazy load" of entity beans in a relationship (like I can do in Hibernate)?

Hi all,

I was prepared for the SCWCD 1.3 exam. But, I've realized that there is a SCWCD 1.4. So I'm studing some new topics like EL and JSTL.

One thing I don't understan is: why (or when) should I use EL instead of JSP expressions?
Doesn't the following code do the same thing??

[ July 29, 2004: Message edited by: Fl�vio Fran�a ]
I've passed!!!
I'm very happy!

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

Thank you all! This forum have really helped me.
16 years ago
I took mine on April 1st. One question: where in the certmanager site will the result be displayed?
[ April 26, 2004: Message edited by: Fl�vio Fran�a ]
16 years ago
Hello All,
I'm building an application that loads records from a database and presents them in a JTable. All seems to work ok, but sometimes the following error is diplayed:

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(
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$ 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 Source)

It's strange because sometimes it's displayed, and sometimes not. I can't identify what is causing the problem, since it happens without any change. Does anyone knows what is going on?

16 years ago
Hi Michel,
The specification says:

Such configuration information must be stored in a file called which must be located in the current working directory.

By "current working directory" I understand that it's the directory where the "runme.jar" is. So, you don't need to get the user directory from the system. Just give a FileOutputStream("") to the store method, and it'll be stored in the current working directory.
I heard that, after uploading the project, you have to wait Sun to send you an email confirming that you can schedule your essay exam. Is it true? Do they verify something in our project before taking the essay exam?
Thanks for helps!

On balance I think method 1 is the better solution in this case. Others may disagree.

Yes, I prefer method 1 too, but it sounds strange on the method create wich throws a DuplicatedKeyException. So, I think I'll use the second one.

Hello all,
The specification says:

Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file.

So, if the DBMain interface declares the methods like that:

How can I notify an IOException when deleting from the database file?

Hi George,
I think it's not the problem , I've set the cursor for the main frame.
This is the whole method: