Package com.dooapp.gaedo.properties

Examples of com.dooapp.gaedo.properties.ClassCollectionProperty


      // 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


              cascade);
      containedProperties.put(
              VALUE_PROPERTY,
              cascade);
      // Adding the class collection property to this class to make sure we can get it back
      containedProperties.put(new ClassCollectionProperty(Map.Entry.class), cascade);
      containedProperties.put(new TypeProperty(), cascade);
    } catch(Exception e) {
      throw new UnableToGetKeyOrValueProperty(e);
    }
  }
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

   */
  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

   */
  private static Iterable<Property> improvePath(GraphDatabaseDriver driver, Iterable<Property> path) {
    /* we declare the class collection property as member of this type, as we won't use it as storage mechanism, but rather as adressing one
     * in which case the given class is not meaningful
     */
    Property classCollection = new ClassCollectionProperty(InstanceOf.class);

    List<Property> list = new ArrayList<Property>(CollectionUtils.asList(path));
    if(list.size()==0) {
      return Arrays.asList(classCollection);
    } else {
View Full Code Here

              cascade);
      containedProperties.put(
              VALUE_PROPERTY,
              cascade);
      // Adding the class collection property to this class to make sure we can get it back
      containedProperties.put(new ClassCollectionProperty(Map.Entry.class), cascade);
      containedProperties.put(new TypeProperty(), cascade);
    } catch(Exception e) {
      throw new UnableToGetKeyOrValueProperty(e);
    }
  }
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().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

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.