예제 #1
0
  public ClientsDomainClass inferFromAnnotations(Class javaClass) {
    List<Property> properties = propertyScanner.scan(javaClass);

    Property foundIdProperty = findIdProperty(properties);

    if (foundIdProperty != null) {
      return new Entity(javaClass, properties, foundIdProperty);
    }

    return create(classAnnotationsScanner.scanAndInfer(javaClass));
  }
예제 #2
0
  public Entity create(EntityDefinition entityDefinition) {

    List<Property> properties = propertyScanner.scan(entityDefinition.getClazz());

    Property idProperty = null;
    if (entityDefinition.hasCustomId()) {
      if (entityDefinition.hasCustomIdDefinedByName()) {
        idProperty = findIdPropertyByName(properties, entityDefinition);
      } else {
        idProperty = entityDefinition.getIdProperty();
      }
    }

    List<Property> filteredProperties = filterIgnored(properties, entityDefinition);
    return new Entity(entityDefinition.getClazz(), filteredProperties, idProperty);
  }
예제 #3
0
 public ValueObject create(ValueObjectDefinition voDefinition) {
   List<Property> properties = propertyScanner.scan(voDefinition.getClazz());
   List<Property> filteredProperties = filterIgnored(properties, voDefinition);
   return new ValueObject(voDefinition.getClazz(), filteredProperties);
 }