Package com.dooapp.gaedo.properties

Examples of com.dooapp.gaedo.properties.ClassCollectionProperty


    if (!classes.containsKey(objectClass)) {
      Map<Property, Collection<CascadeType>> beanPropertiesFor = StrategyUtils.getBeanPropertiesFor(propertyProvider, objectClass, migrator);
      // Finally, create a fake "classesCollection" property and add it to
      // property
      try {
        beanPropertiesFor.put(new ClassCollectionProperty(objectClass), new LinkedList<CascadeType>());
        beanPropertiesFor.put(new TypeProperty(objectClass), new LinkedList<CascadeType>());
      } catch (Exception e) {
        logger.log(Level.SEVERE, "what ? a class without a \"class\" field ? WTF", e);
      }
      classes .put(objectClass, beanPropertiesFor);
View Full Code Here


   * @return
   * @see com.dooapp.gaedo.blueprints.strategies.AbstractMappingStrategy#addDefaultSearchToAndTest(com.dooapp.gaedo.blueprints.queries.tests.AndVertexTest)
   */
  @Override
  protected CompoundVertexTest addDefaultSearchToAndTest(AndVertexTest vertexTest) {
    ClassCollectionProperty classCollectionProperty = new ClassCollectionProperty(serviceContainedClass);
    TestContainsClassProperty visitor = new TestContainsClassProperty(classCollectionProperty);
    vertexTest.accept(visitor);
    if(!visitor.isClassTested()) {
      CollectionContains objectClassContains = new CollectionContains(vertexTest.getDriver(),
              Arrays.asList(new Property[] { classCollectionProperty }), serviceContainedClass);
View Full Code Here

   */
  protected Collection<Vertex> getVerticesToExamine() {
    List<Vertex> returned = new LinkedList<Vertex>();
    // First step is to locate the class node
    Vertex classVertex = getClassVertex();
    ClassCollectionProperty classes = new ClassCollectionProperty(getSearchedClass());
    if(classVertex==null) {
      if (logger.isLoggable(Level.WARNING)) {
        logger.log(Level.WARNING, "graph doesn't seem to know source class "+getSearchedClass().getCanonicalName());
      }
      return returned;
View Full Code Here

   */
  protected Iterable<Vertex> getVerticesToExamine() {
    List<Vertex> returned = new LinkedList<Vertex>();
    // First step is to locate the class node
    Vertex classVertex = getClassVertex();
    ClassCollectionProperty classes = new ClassCollectionProperty(getSearchedClass());
    if(classVertex==null) {
      if (logger.isLoggable(Level.WARNING)) {
        logger.log(Level.WARNING, "graph doesn't seem to know source class "+getSearchedClass().getCanonicalName());
      }
      return returned;
View Full Code Here

      // Migrator has no cascade to be done on
      returned.put(migrator.getMigratorProperty(returned.keySet()), new LinkedList<CascadeType>());
    }
    // Finally, create a fake "classesCollection" property and add it to property
    try {
      returned.put(new ClassCollectionProperty(containedClass), new LinkedList<CascadeType>());
    } catch (Exception e) {
      logger.log(Level.SEVERE, "what ? a class without a \"class\" field ? WTF", e);
    }
    return returned;
  }
View Full Code Here

    if (!classes.containsKey(objectClass)) {
      Map<Property, Collection<CascadeType>> beanPropertiesFor = StrategyUtils.getBeanPropertiesFor(propertyProvider, objectClass, migrator);
      // Finally, create a fake "classesCollection" property and add it to
      // property
      try {
        ClassCollectionProperty classes = new ClassCollectionProperty(objectClass).withAnnotation(new ManyObjectsToOneType(objectClass.getClass()));
        beanPropertiesFor.put(classes, StrategyUtils.extractCascadeOfJPAAnnotations(classes));
        TypeProperty type = new TypeProperty(objectClass).withAnnotation(new ManyObjectsToOneType(objectClass.getClass()));
        beanPropertiesFor.put(type, StrategyUtils.extractCascadeOfJPAAnnotations(type));
      } catch (Exception e) {
        logger.log(Level.SEVERE, "what ? a class without a \"class\" field ? WTF", e);
      }
      classes .put(objectClass, beanPropertiesFor);
    }
    return classes.get(objectClass);
  }
View Full Code Here

   * @return
   * @see com.dooapp.gaedo.blueprints.strategies.AbstractMappingStrategy#addDefaultSearchToAndTest(com.dooapp.gaedo.blueprints.queries.tests.AndVertexTest)
   */
  @Override
  protected CompoundVertexTest addDefaultSearchToAndTest(AndVertexTest vertexTest) {
    ClassCollectionProperty classCollectionProperty = new ClassCollectionProperty(serviceContainedClass);
    TestContainsClassProperty visitor = new TestContainsClassProperty(classCollectionProperty);
    vertexTest.accept(visitor);
    if(!visitor.isClassTested()) {
      CollectionContains objectClassContains = new CollectionContains(this,
              vertexTest.getDriver(), Arrays.asList(new Property[] { classCollectionProperty }), serviceContainedClass);
View Full Code Here

      // Migrator has no cascade to be done on
      returned.put(migrator.getMigratorProperty(returned.keySet()), new LinkedList<CascadeType>());
    }
    // Finally, create a fake "classesCollection" property and add it to property
    try {
      returned.put(new ClassCollectionProperty(containedClass), new LinkedList<CascadeType>());
    } catch (Exception e) {
      logger.log(Level.SEVERE, "what ? a class without a \"class\" field ? WTF", e);
    }
    return returned;
  }
View Full Code Here

      // Migrator has no cascade to be done on
      returned.put(migrator.getMigratorProperty(returned.keySet()), new LinkedList<CascadeType>());
    }
    // Finally, create a fake "classesCollection" property and add it to property
    try {
      returned.put(new ClassCollectionProperty(containedClass), new LinkedList<CascadeType>());
    } catch (Exception e) {
      logger.log(Level.SEVERE, "what ? a class without a \"class\" field ? WTF", e);
    }
    return returned;
  }
View Full Code Here

   * @return
   */
  private static CompoundVertexTest addClassSearchTo(CompoundVertexTest vertexTest, Class searchedClass) {
    if (vertexTest instanceof AndVertexTest) {
      CollectionContains objectClassContains = new CollectionContains(vertexTest.getRepository(),
              Arrays.asList(new Property[] { new ClassCollectionProperty(searchedClass) }), searchedClass);
      vertexTest.add(objectClassContains);
      return vertexTest;
    } else {
      // Create a new Andtest, add to it current vertex test and test on
      // class
View Full Code Here

TOP

Related Classes of com.dooapp.gaedo.properties.ClassCollectionProperty

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.