Second Step for Cayenne

From: sarvesh.naid..t.com
Date: Thu Jul 29 2004 - 09:45:23 EDT

  • Next message: Andrus Adamchik: "Re: modeller selecting a objentity attribute row"

    Hi,
     Now that I have been able to insert values, next is retrieving them, how does this work? Firstly I have been working a lot with EJB, so remote and local references have always been a part of everything. But now that I am using cayenne, its different. To give you an example, I am trying to work on a project which I had successfully implemented using EJB CMR. I have a table called Role, and I have inserted values by creating a new instance of datacontext and registering the Role object to the context, and then comitting it. How do I get the values back?

    Role role1 = (Role) context.createAndRegisterNewObject("Role");
            role1.setRoleName("Sarvesh1");
                role1.setRoleDescription("Cayenne Test11");
            context.commitChanges();

    I understand that a getRole() should return me a role class, so that I can call the getXXX() on it. But how do I get the Role class is the question.Could anyone please explain.
    Thanks

    Regards,
    Sarvesh Naidu
    Wholesale Portal Team
    * (0)20 7322 4645
    *sarvesh.naid..t.com



    This archive was generated by hypermail 2.0.0 : Thu Jul 29 2004 - 09:44:50 EDT