Hibernate version: 3.3.1
Hibernate Annotations version: 3.4
Hello,
I've searched the forums and documentation all day. What on earth am I doing wrong. Loading just one object results in 10 SQL queries. It's being caused by my many-to-ones, but they're all set to lazy. I'm all out of ideas. Please help!?
Example of my association mappings:
Code:
@ManyToOne(cascade = {}, fetch=FetchType.LAZY)
@NotFound(action = NotFoundAction.IGNORE)
@JoinColumn(name = "user_id")
@LazyToOne(LazyToOneOption.PROXY)
public User getUser()
{
return user;
}
This will result in eager loading (by select) of all my many-to-one's and cascades into eager fetching of their associations as well:
Code:
session.get(User.class, 1);
Does anybody have any suggestions of what I can try next?