Brian Kuhn

Greenhorn
+ Follow
since Nov 19, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Brian Kuhn

I don't know why my last 2 replies show up blank, but I still want to mention:

The above code uses the same instance of HashSet for userRole and adminRole. I also tried this:



but I got the same problem. I also tried out this project with MySQL 3.0.16. Same issue. In case anyone wants to try this out, I've published the project at:

http://java.briankuhn.com/SimpleHibernateDemo.zip
I don't know why my last reply shows up blank, but I also wanted to mention:

The above code uses the same instance of HashSet for userRole and adminRole. I also tried this:



but I got the same problem. I also tried out this project with MySQL 3.0.16. Same issue. In case anyone wants to try this out, I've published the project at:

http://java.briankuhn.com/SimpleHibernateDemo.zip
I almost forgot to mention, the above code uses the same instance of HashSet for userRole and adminRole.

The following code gave me the exact same result:


I also tried out this project with MySQL 3.0.16 and had the same problem.

In case anyone wants to try this out, I've published the project at:
SimpleHibernateDemo.zip
I have two objects to persist; Account and Role. Account has a String username, a String password and a Set of Roles. Role has a String name, and a Set of Accounts. Hibernate creates a join table called accountroles to manage the Sets' many-to-many relationship. Everything works fine; Hibernate generates the correct SQL as far as I can tell. I inserted intermediate commits at each step just to make sure. On the last commit, I get a java.lang.StackOverflowError. I assume this has something to do with the bidirectional nature of the relationship. I must be getting an infinite loop of recursion or something. Any idea what I did wrong?

Thanks!

Hibernate version:
version 3.0.2 , 27.04.2005

Config file:



Mapping documents:
Account.hbm.xml


Role.hbm.xml



Code between sessionFactory.openSession() and session.close():



Schema-export.sql:



Full stack trace of any exception that occurs:
java.lang.StackOverflowError (that's it)


Name and version of the database you are using:
hsqldb_1_7_3_3


The generated SQL (show_sql=true):


Debug level Hibernate log excerpt:

System.out.printf() does not require the explicit creation of a Formatter.



I'm sometimes a little dense...can you spell this out for me? The two java.io.PrintWriter methods in question have the exact same signature:

public PrintWriter format(String format, Object... args)
public PrintWriter printf(String format, Object... args)

And according to the javadocs, they do the same thing. How is one more convienent than the other? I'm not seeing how either requires the creation of a Formatter. Perhaps you thought I was talking about Formatter's format method.

Thanks,
Brian
Is there any difference between PrintWriter.format and PrintWriter.printf? The printf api says, "An invocation of this method of the form out.printf(format, args) behaves in exactly the same way as the invocation out.format(format, args)." If this is the case, what's the point of having two methods that do the same thing?
I passed the SCJP with a 95%, but how should I add this to my resume? It's the only certification that I have. Anyone have an example of resume format?
Thanks,
Brian
21 years ago