Examples of Parent


Examples of com.google.appengine.datanucleus.test.jpa.SingleTableInheritanceJPA.Parent

    testCreateAndFindParentAndChildren(NEW_EM_START_END);
  }
  @SuppressWarnings("unchecked")
  private void testCreateAndFindParentAndChildren(StartEnd startEnd) throws Exception {
    //  create Parent
    Parent p = newParent(startEnd, "Parent");
    Long pId = p.getId();
    Key pKey = KeyFactory.createKey(PARENT_KIND, pId);
   
    //  verify Parent entity
    Entity pe = ds.get(pKey);
    Assert.assertEquals(pKey, pe.getKey());
    Assert.assertEquals("P", pe.getProperty("DTYPE"));
    Assert.assertEquals("Parent", pe.getProperty("parentStr"));
    Assert.assertEquals(2, pe.getProperties().size());
   
    //  verify Parent object
    startEnd.start();
    p = em.find(Parent.class, pId);
    Assert.assertEquals(pId, p.getId());
    Assert.assertEquals("Parent", p.getParentStr());
    startEnd.end();

    //  create Child11
    Child11 c11 = newChild11(startEnd, "Child11", 11);
    Long c11Id = c11.getId();
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.SubclassesJPA.Parent

    Entity e = new Entity(kindForClass(parentClass));
    e.setProperty("aString", "a");
    ds.put(e);

    beginTxn();
    Parent parent = em.find(parentClass, e.getKey());
    assertEquals(parentClass, parent.getClass());
    assertEquals("a", parent.getAString());
    commitTxn();
  }
View Full Code Here

Examples of com.google.code.gaeom.annotation.Parent

        String[] path = field.split("\\.");
        Field f = encoder.getField(path);
        if (f == null)
          throw new IllegalArgumentException("No such field " + field + " on class " + type);

        Parent parentAnno = f.getAnnotation(Parent.class);
        if (parentAnno != null)
        {
          switch (parentAnno.value())
          {
            case AncestorQuery :
            {
              if (gop == FilterOperator.EQUAL)
                return ancestor(value);
              else
                throw new IllegalArgumentException("Cannot filter on parent-key encoded field " + field + " in class " + type + " using " + gop);
            }
            case NoFilter :
            {
              throw new IllegalArgumentException("No filtering on FilterPolicy." + parentAnno.value() + " parent relationships.");
            }
            case RetainKey :
              // all good in this case
          }
        }
View Full Code Here

Examples of com.google.code.gaeom.annotation.Parent

        {
          return new EmbeddedEncoder(propertyName, clazz, os);
        }
        else
        {
          Parent parent = field.getAnnotation(Parent.class);
          if (parent != null && parent.value() != Parent.FilterPolicy.RetainKey)
            return new ParentRelationshipEncoder(field.getName());
          else
            return new RelationshipEncoder(field.getName(), propertyName, field.isAnnotationPresent(Child.class), index);
        }
      }
View Full Code Here

Examples of com.jfinal.ext.interceptor.pageinfo.Parent

    }
   

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public List<M> children(Class<? extends Model> model) {
        Parent child = model.getAnnotation(Parent.class);
        String foreignKey = child.foreignKey();
        Class<? extends Model> childModel = child.model();
        String childTableName = TableMapping.me().getTable(childModel).getName();
        String primaryKey = TableMapping.me().getTable(clazz).getPrimaryKey();
        try {
            return childModel.newInstance().find("select * from " + childTableName + " where " + foreignKey + "= ?",
                    get(primaryKey));
View Full Code Here

Examples of de.pdark.decentxml.Parent

                    Element descr = findOrCreateDescriptionOnNextElement(e, idx, root);
                    if (descr == null) {
                        // lets move the comment node to before the root element...
                      Activator.getLogger().warning("No description node found");
                        e.removeNode(c);
                        Parent grandParent = root.getParent();
                        if (grandParent != null) {
                            grandParent.addNode(grandParent.nodeIndexOf(root), c);
                        } else {
                          Activator.getLogger().warning("Cannot save the comment '" + text + "' as there's no parent in the DOM");
                        }
                    } else {
                        if (descr.getNodes().size() > 0) {
View Full Code Here

Examples of electric.xml.Parent

                            nsMap.put( prefix,
                                       new Namespace(elem, prefix, uri) );
                        }
                    }
                }
                Parent parent = current.getParent();
                if ( parent instanceof Element )
                    current = (Element)parent;
                else
                    break;
            }
View Full Code Here

Examples of eva.schedule.Parent

    } catch (JDOMException e) {
      throw new InvalidWishesFile("could not find the events node in the XML file (" + parentsPath + ")", e);
    }
    nodeIter = nodeList.iterator();
   
    Parent parent;
    int id = 0;
    String firstName = null;
    String lastName = null;
    String eMail = null;
    String useEMail = null;
   
    while(nodeIter.hasNext()) {
      node = (Element) nodeIter.next();
     
      id = Integer.parseInt(node.getAttributeValue("id"));
      firstName = node.getAttributeValue("firstname");
      lastName = node.getAttributeValue("lastname");
      useEMail = node.getAttributeValue("use-email");
      if(useEMail.equals("true")) {
        eMail = node.getAttributeValue("email");
      }
      else {
        eMail = null;
      }
     
      if(firstName != null && lastName != null && id > 0) {
        parent = new Parent(id, firstName, lastName, eMail);
        eveningSchedule.add(parent);
       
        readParentVisits(parent, node);
      }
      else {
View Full Code Here

Examples of hivemind.test.config.impl.Parent

        List l = (List) r.getConfiguration("hivemind.test.config.SetParent");

        assertEquals(1, l.size());

        Parent p1 = (Parent) l.get(0);

        assertEquals("key1", p1.getKey());
        assertEquals("value1", p1.getValue());

        l = p1.getChildren();
        assertEquals(2, l.size());

        Child c1 = (Child) l.get(0);

        assertSame(p1, c1.getParent());
View Full Code Here

Examples of hivemind.test.config.impl.Parent

        List l = r.getConfiguration("hivemind.test.config.SetParent");

        assertEquals(1, l.size());

        Parent p1 = (Parent) l.get(0);

        assertEquals("key1", p1.getKey());
        assertEquals("value1", p1.getValue());

        l = p1.getChildren();
        assertEquals(2, l.size());

        Child c1 = (Child) l.get(0);

        assertSame(p1, c1.getParent());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.