I have no answer to your question, but ... why are you messing around with βtoolsβ to make your individual association lazy? I checked the following for a one-to-one relationship between a class Fooand its FooDetail:
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
public FooDetail getFooDetail() {
return detail;
}
And lazy loading just works . This is the statement executed when the instance is retrieved Foo:
Hibernate: select foo0_.id as id45_0_, foo0_.detail_id as detail3_45_0_, foo0_.shortName as shortName45_0_ from Foo foo0_ where foo0_.id =?
And, later, when calling the getter, it selects FooDetail:
Hibernate: select foodetail0_.id as id46_0_, foodetail0_.fullName as fullName46_0_ from FooDetail foodetail0_ where foodetail0_.id =?
Foo , :
Hibernate: delete from Foo where id=?
Hibernate: delete from FooDetail where id=?
, DDL, Hibernate :
create table Foo (id bigint not null, shortName varchar(255), detail_id bigint, primary key (id))
create table FooDetail (id bigint not null, fullName varchar(255), primary key (id))
alter table Foo add constraint FK212C3F68B31178 foreign key (detail_id) references FooDetail
Hibernate 3.4.0.GA.
: , , "--", - (, , , , ).