Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,36 @@ public String getEntityName() {

@Override
public final Type getPropertyType(String propertyPath) {
Type result = propertyTypesByName.get(propertyPath);
if (result!=null) {
return result;
final Type cached = propertyTypesByName.get(propertyPath);
if ( cached == null ) {
final Type type = propertyType( propertyPath );
if ( type != null ) {
propertyTypesByName.put( propertyPath, type );
}
return type;
}
else {
return cached;
}
}

result = createPropertyType(propertyPath);
if (result == null) {
//check subclasses, needed for treat()
result = getSubclassPropertyType(propertyPath);
private Type propertyType(String propertyPath) {
final Type type = createPropertyType( propertyPath );
if ( type != null ) {
return type;
}

if ("id".equals( propertyPath )) {
result = identifierType();
//check subclasses, needed for treat()
final Type typeFromSubclass = getSubclassPropertyType( propertyPath );
if ( typeFromSubclass != null ) {
return typeFromSubclass;
}

if (result!=null) {
propertyTypesByName.put(propertyPath, result);
if ( "id".equals( propertyPath ) ) {
return identifierType();
}
return result;

return null;
}

abstract Type createPropertyType(String propertyPath);
Expand Down