Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: When are Entities-Classes enhanced and what for? jpa, spring
PostPosted: Thu May 17, 2012 3:15 pm 
Newbie

Joined: Thu May 17, 2012 2:57 pm
Posts: 1
I am using spring 3.0.6, jpa 2.0, hibernate 3.6.8. My question is, in which situations is javassist used to create "proxy" for a EntityClass? And what is reason of this proxy? I have the following Entity:

Code:
@Entity
public MyEntity{
..

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "adresseID")
  private Adresse adresse;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "myEntity")
  private List<Parameter> parameters;

..
}

When I load a MyEntity from db, the class of entity is something like MyEntity__$$_javassist. Why is it done? What for? I think that just regular class MyEntity can be used here .

To implement lazy loading, we can:
- for @OneToMany - PersistenceBag can be used here
- for @ManyToOne - here should be used "enchancedClass" like Adress_$$_javassist

So what is reason for enchancing MyEntity? Where I can read something more about it? Which book/article/blog can you recommend me?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.