problem preventing initialization associated entity

View: New views
2 Messages — Rating Filter:   Alert me  

problem preventing initialization associated entity

by AlexjeC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi i have an entity A with a OneToOne bidirectional relation/association  with an entity B

 when i query for all entities of type A i also get all B entities, while on both sides the annotation  fetchtype = lazy... anyone know why this happens/how to prevent it ?

tnx


@OneToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)

Re: problem preventing initialization associated entity

by James Sutherland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What JPA provider are you using?  Many JPA providers required that an agent or static weaver be used to enable lazy on OneToOne.