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)); }
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); }
public ValueObject create(ValueObjectDefinition voDefinition) { List<Property> properties = propertyScanner.scan(voDefinition.getClazz()); List<Property> filteredProperties = filterIgnored(properties, voDefinition); return new ValueObject(voDefinition.getClazz(), filteredProperties); }