Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6827829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:18:41+00:00 2026-05-26T22:18:41+00:00

My bean looks like that: @Entity public class Fattura { @Id Long id; @NotEmpty

  • 0

My bean looks like that:

@Entity
public class Fattura {

    @Id
    Long id;

    @NotEmpty
    String numero;

    @Min(value=0)
    Double importo;

    Key<User> utente;

    // gets & sets....
}

The “utente” property is the key of another bean I created: a “Fattura” can have only one “User”, one “User” can have many “Fattura”s

My Spring MVC controller will manage a request for a list of Fattura and display them in a simple jsp:

@RequestMapping( value = "/fatture" , method = RequestMethod.GET )
    public ModelAndView leFatture() {

        ModelAndView mav = new ModelAndView("fatture");


        mav.addObject("fatture",fatturaService.listFatture());

        return mav;
    }

the code of the jsp is really simple: only a foreach cycle in a table

My question is:

how can I display the “utente”?

The only thing I have is its key, but I’d like to do something like ${fattura.utente.firstName} in my JSP, how can I do it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:18:41+00:00Added an answer on May 26, 2026 at 10:18 pm

    Unfortunately you would have to manually fetch “utente” in your DAO class. There is no automatic fetching in Objectify like in Twig. In my POJOs I have following fields

    @Transient private Organization sender;             // Pickup location (for client RPC)
    transient private Key<Organization> senderKey;      // Pickup location (for Datastore)
    

    I load entity from Datastore and then load manually Organization using senderKey.

    In new Objectify4 you’ll be able to do what you want like this:

    class Beastie {
       @Parent
       @Load
       ParentThing parent;
    
       @Id Long id;
    
       @Load({"bigGroup", "smallGroup"})
       SomeThing some;
    
       @Load("bigGroup")
       List<OtherThing> others;
    
       @Load
       Ref<OtherThing> refToOtherThing;
    
       Ref<OtherThing> anotherRef;  // this one is never fetched automatically
    }
    

    Here is evolving design document of new version.

    Update at Nov 17, 2011: This is big news. Twig author, John Patterson, joined Objectify project today.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Bean that looks like this Class Person{ private String name; private
Im receiving this <header><h1>001</h1><h2>002</h2></header> my dispatcher looks like this <bean id=annotatedMarshaller class=org.springframework.oxm.xstream.AnnotationXStreamMarshaller> <property name=annotatedClasses>
I have a bean mongoService which looks like as <?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans
I have a spring bean that I get like this within a method- repAppCaller
From viewing the source code that this code makes it looks like itemValue generate
I have main page that looks like this: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
We have a very complex config file for JSF managed beans that looks like
I have an entity class User that contains information such as username, first name,
Error creating bean with name 'sessionFactory' defined in class path resource [ApplicationContext.xml]: Invocation of
I have a bean that describes my session factory. I only want to load

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.