Package org.nutz.dao.impl.entity.field

Examples of org.nutz.dao.impl.entity.field.ManyManyLinkField


      for (LinkInfo li : manys) {
          en.addLinkField(new ManyLinkField(en, holder, li));
      }
      // 多对多 '@ManyMany'
      for (LinkInfo li : manymanys) {
          en.addLinkField(new ManyManyLinkField(en, holder, li));
      }
      // 检查复合主键
      en.checkCompositeFields(null == ti.annPK ? null : ti.annPK.value());

      /*
 
View Full Code Here


*/
public class DoClearRelationByLinkedFieldLinkVisitor extends AbstractLinkVisitor {

    public void visit(Object obj, LinkField lnk) {
        if (lnk instanceof ManyManyLinkField) {
            final ManyManyLinkField mm = (ManyManyLinkField) lnk;
            Object value = mm.getValue(obj);
            if (Lang.length(value) == 0)
                return;

            final Pojo pojo = opt.maker().makeDelete(mm.getRelationName());
            pojo.append(Pojos.Items.cndColumn(mm.getToColumnName(), mm.getLinkedField(), null));

            Lang.each(value, new Each<Object>() {
                public void invoke(int i, Object ele, int length) throws ExitLoop, LoopException {
                    pojo.addParamsBy(mm.getLinkedField().getValue(ele));
                }
            });

            opt.add(pojo);
        }
View Full Code Here

TOP

Related Classes of org.nutz.dao.impl.entity.field.ManyManyLinkField

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.