Wednesday, September 17, 2008

Rada

Dzisiaj podczas szukania czegoś na temat hibernate znalazłem ciekawą stronkę na, którą jakimś dziwnym trafem nigdy nie trafiłem :)

Common Problems

A na niej złotymi zgłoskami ważną rade...


I'm having trouble with a bidirectional association.

When you update a bidirectional association you must update both ends.
parent.getChildren().add(child);
child.setParent(parent);

It's best to do this in an association management method of your persistent class.


I'm still having trouble!

Read the documentation! There's a detailed section about "Parent/Child Relationships" in chapter 16 of the reference documentation including code examples.


Tak to w życiu bywa... że chcesz czy nie chcesz dokumentacje przeczytać warto, a nawet trzeba :)