Package org.jugile.daims.anno

Examples of org.jugile.daims.anno.ConnectionNN


      Connection1N c = f.getAnnotation(Connection1N.class);
      if (c != null) {
        o.setN1(c.o(), this); // use other end setter
        return this;
      }
      ConnectionNN nn = f.getAnnotation(ConnectionNN.class);
      if (nn != null) {
        ((BoCollection<Bo>)f.get(this)).add(o);
        o.getBoCollection(nn.c()).add(this); // update other end index
        return this;
      }
    } catch(Exception e) { fail(e); }
    return this;
  }
View Full Code Here


      if (c != null) {
        //log.debug("remove 1N by calling o.setN1");
        o.setN1(c.o(), null); // use other end setter and set null
        return;
      }
      ConnectionNN nn = f.getAnnotation(ConnectionNN.class);
      if (nn != null) {
        //log.debug("remove NN: " + o + " " + name);
        ((BoCollection<Bo>)f.get(this)).remove(o,false);
        o.getBoCollection(nn.c()).remove(this,false); // update other end index
        return;
      }
    } catch(Exception e) { fail(e); }
    return;
  }
View Full Code Here

  protected void addOriginNN(String name, Bo o) {
    if (o == null) return;
    try {
      Field f = fld(name);
      ConnectionNN nn = f.getAnnotation(ConnectionNN.class);
      if (nn == null) fail("not a nn collection");
      getBoMap(name).add(o);
      o.getBoMap(nn.c()).add(this); // update other end index
    } catch(Exception e) { fail(e); }
  }
View Full Code Here

 
  protected void removeOriginNN(String name, long id) {
    try {
      //log.debug("removeOriginNN: " + name + " id: " + id);
      Field f = fld(name);
      ConnectionNN nn = f.getAnnotation(ConnectionNN.class);
      if (nn == null) fail("not a nn collection");
      Bo o = getBoMap(name).remove(id);
      if (o != null) o.getBoMap(nn.c()).remove(this); // update other end index     
    } catch(Exception e) { fail(e); }
  }
View Full Code Here

  }

  protected Class getOtherEndClass(String name) {
    try {
      Field f = fld(name);
      ConnectionNN nn = f.getAnnotation(ConnectionNN.class);
      if (nn == null) fail("not a nn collection");
      int l = "Collection".length();
      String cname = f.getType().getName();
      cname = cname.substring(0, cname.length()-l);
      return getClassByName(cname);
View Full Code Here

      if (type == FldType.C1N) {
        Connection1N c = f.getAnnotation(Connection1N.class);
        if (c == null) continue;       
      }
      if (type == FldType.NN) {
        ConnectionNN c = f.getAnnotation(ConnectionNN.class);
        if (c == null || !c.first()) continue;
        //if (c == null || c.first()) continue;
      }
      if (type == FldType.COL) {
        Connection1N c = f.getAnnotation(Connection1N.class);
        ConnectionNN nn = f.getAnnotation(ConnectionNN.class);
        if (c == null && nn == null) continue;
      }
      f.setAccessible(true);
      res.add(f);
    }
View Full Code Here

TOP

Related Classes of org.jugile.daims.anno.ConnectionNN

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.