Home Help Center

How can I defined the class in ice?

ren-weiren-wei Member wei renOrganization: Hainan AirlineProject: support external system connect ticketsalesystem
HI,
if i have two classes (A and B) which are many to many .how can I defined them?
Class A{
private long id;
private Set<B> agentGroups = new HashSet<B>(0)
}
Class B{
private long id;
private Set<A> agents = new HashSet<A>(0);
}

Comments

  • ren-weiren-wei Member wei renOrganization: Hainan AirlineProject: support external system connect ticketsalesystem
    I use java and ice3.4.1
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    The equivalent Slice definitions would be something like:
    module Demo
    {
    
    class A;
    class B;
    
    sequence<A> ASeq;
    sequence<B> BSeq;
    
    class A
    {
       long id;
       BSeq agentGroups;
    };
    
    class B
    {
      long id;
      ASeq agents;
    };
    
    };
    

    Best regards,
    Bernard
  • ren-weiren-wei Member wei renOrganization: Hainan AirlineProject: support external system connect ticketsalesystem
    thank you!
Sign In or Register to comment.