简体   繁体   中英

Retrieving Entity Performance in JPA

Below is the code I used to retrieve Profile entity:

    EntityManager em = EMF.get().createEntityManager();
    return em.find(Profile.class, email);

If Profile have a lot of properties and some are List or Set and if I only need 3 String properties (eg, Last Name, First Name, birthday), is it okay to retrieve using the above code or I have to write a query retrieving only those 3 properties?

By the way, the application is run under Google App Engine.

Thanks

I think AppEngine doesn't allow you to select only 3 properties from an entity. All entities stored in AppEngine will be considered as a unit that you can't spit it up.

However, if the Profile entity has some child-entities, then it would be better not to fetch them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM