Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lazy Loading of References

I have a java class with a member:

@Entity
public class TypeA {
    ...
    @Reference(lazy = true) private TypeB anObj;
    ...
}

Now when I do a datastore.find(TypeA.class).asList().get(0), the reference also gets loaded and I get the message "WARNING: Lazy loading impossible due to missing dependencies." logged to the console.

What are the dependencies I'm missing and how do I include them?

like image 542
Gautham Badhrinathan Avatar asked Oct 19 '25 03:10

Gautham Badhrinathan


1 Answers

You'll need to add this to your pom.xml (if you're using maven):

<dependency>
    <groupId>cglib</groupId>
    <artifactId>cglib-nodep</artifactId>
    <version>[2.1_3,3.0)</version>
    <type>jar</type>
    <optional>true</optional>
</dependency>
<dependency>
    <groupId>com.thoughtworks.proxytoys</groupId>
    <artifactId>proxytoys</artifactId>
    <version>1.0</version>
    <type>jar</type>
    <optional>true</optional>
</dependency>
like image 181
evanchooly Avatar answered Oct 21 '25 18:10

evanchooly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!