Would the Null Object pattern be of help here?
http://www.developer.com/design/article.php/3697611
http://en.wikipedia.org/wiki/Null_Object_pattern
Instead of inserting new Addresses, Hibernate could associate the Person with a single "null" address of a designated id.
e.g.:
Code:
public class NullAddress extends Address {
// make this a singleton
private static NullAddress singleNullAddress = new NullAddress(true);
private NullAddress(boolean uglyHack) {} // <-- there's probably a better way
public NullAddress () { return singleNullAddress; }
public Long getId() { return 0; } // or another special id
public String getStreet() { return ""; }
...etc...
public boolean isNull() { return true; }
}
I haven't actually implemented something like this yet. I assume there would be many more kinks to work out.