Package com.dooapp.gaedo.properties

Examples of com.dooapp.gaedo.properties.ClassCollectionProperty


                } else {
                  // Internal class means getName will introduce an unwanted "$" sign
                  Logger logger = Logger.getLogger(operation.getClass().getCanonicalName());
                  if(logger.isLoggable(Level.FINE)) {
                    // just don't output anything for type or class collections, as they're special properties
                    if(!(TypeProperty.INSTANCE.equals(p) || new ClassCollectionProperty(getClass()).equals(p)))
                    logger.log(Level.FINE, "operation not performed on "+p.toGenericString()+" has no cascade "+cascade+" defined");
                  }
                }
                // We only perform operations on cascaded fields
                if(used!=null) {
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

              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

  @Override
  protected boolean callMatchManaged(Vertex currentVertex, Property finalProperty) {
    /* 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(this.getClass());
    List<Property> localPath = Arrays.asList(classCollection);
    CollectionContains classesContains = new CollectionContains(strategy, driver, localPath, expected);
    /*
     * Now classes are stored as literal values, this distinction is quite important
     */
 
View Full Code Here

                if (entry.getValue().contains(cascade)) {
                    used = cascade;
                } else {
                  if(logger.isLoggable(Level.FINE)) {
                    // just don't output anything for type or class collections, as they're special properties
                    if(!(TypeProperty.INSTANCE.equals(p) || new ClassCollectionProperty(getClass()).equals(p)))
                    logger.log(Level.FINE,
                            String.format("operation %s not performed on %s has no cascade %s defined\n"
                                    + "To fix that, simply add %s.%s to its JPA annotation",
                                    operationSimpleName,
                                    p.toGenericString(),
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

    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

    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

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.