Skip to content

Commit

Permalink
Runtime: Remove entity tag from type mapper toJavaType-method
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil Forslund committed Aug 15, 2016
1 parent 50917b1 commit 96cc216
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 20 deletions.
Expand Up @@ -67,14 +67,12 @@ public interface TypeMapper<DB_TYPE, JAVA_TYPE> {
/**
* Converts a value from the database domain to the java domain.
*
* @param <ENTITY> the type of the entity
*
* @param column the column that is being mapped
* @param entityType the entity type that the mapping is for
* @param value the value to convert
* @return the converted value
*/
<ENTITY> JAVA_TYPE toJavaType(Column column, Class<ENTITY> entityType, DB_TYPE value);
JAVA_TYPE toJavaType(Column column, Class<?> entityType, DB_TYPE value);

/**
* Converts a value from the java domain to the database domain.
Expand Down
Expand Up @@ -41,7 +41,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Double toJavaType(Column column, Class<ENTITY> entityType, BigDecimal value) {
public Double toJavaType(Column column, Class<?> entityType, BigDecimal value) {
return value == null ? null : value.doubleValue();
}

Expand Down
Expand Up @@ -40,7 +40,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Boolean toJavaType(Column column, Class<ENTITY> entityType, Integer value) {
public Boolean toJavaType(Column column, Class<?> entityType, Integer value) {
return value == null ? null : value != 0;
}

Expand Down
Expand Up @@ -43,7 +43,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> String toJavaType(Column column, Class<ENTITY> entityType, Clob value) {
public String toJavaType(Column column, Class<?> entityType, Clob value) {
if (value == null) {
return null;
} else try {
Expand Down
Expand Up @@ -53,7 +53,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> T toJavaType(Column column, Class<ENTITY> entityType, T value) {
public T toJavaType(Column column, Class<?> entityType, T value) {
return value;
}

Expand Down
Expand Up @@ -42,7 +42,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Locale toJavaType(Column column, Class<ENTITY> entityType, String value) {
public Locale toJavaType(Column column, Class<?> entityType, String value) {
return value == null ? null : new Locale(value);
}

Expand Down
Expand Up @@ -40,7 +40,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Boolean toJavaType(Column column, Class<ENTITY> entityType, String value) {
public Boolean toJavaType(Column column, Class<?> entityType, String value) {
return value == null ? null : Boolean.valueOf(value);
}

Expand Down
Expand Up @@ -40,7 +40,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Boolean toJavaType(Column column, Class<ENTITY> entityType, String value) {
public Boolean toJavaType(Column column, Class<?> entityType, String value) {
return value == null ? null : value.equalsIgnoreCase("yes");
}

Expand Down
Expand Up @@ -42,7 +42,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Integer toJavaType(Column column, Class<ENTITY> entityType, Date value) {
public Integer toJavaType(Column column, Class<?> entityType, Date value) {
return value == null ? null : (int) (value.getTime() / 1000);
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> LocalDate toJavaType(Column column, Class<ENTITY> entityType, Date value) {
public LocalDate toJavaType(Column column, Class<?> entityType, Date value) {
return value.toLocalDate();
}

Expand Down
Expand Up @@ -43,7 +43,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Long toJavaType(Column column, Class<ENTITY> entityType, Date value) {
public Long toJavaType(Column column, Class<?> entityType, Date value) {
return value == null ? null : value.getTime();
}

Expand Down
Expand Up @@ -42,7 +42,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Integer toJavaType(Column column, Class<ENTITY> entityType, Time value) {
public Integer toJavaType(Column column, Class<?> entityType, Time value) {
return value == null ? null : (int) (value.getTime() / 1000);
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> LocalTime toJavaType(Column column, Class<ENTITY> entityType, Time value) {
public LocalTime toJavaType(Column column, Class<?> entityType, Time value) {
return value.toLocalTime();
}

Expand Down
Expand Up @@ -42,7 +42,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Long toJavaType(Column column, Class<ENTITY> entityType, Time value) {
public Long toJavaType(Column column, Class<?> entityType, Time value) {
return value == null ? null : value.getTime();
}

Expand Down
Expand Up @@ -41,7 +41,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Integer toJavaType(Column column, Class<ENTITY> entityType, Timestamp value) {
public Integer toJavaType(Column column, Class<?> entityType, Timestamp value) {
return value == null ? null : (int) (value.getTime() / 1000);
}

Expand Down
Expand Up @@ -48,7 +48,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> LocalDateTime toJavaType(Column column, Class<ENTITY> entityType, Timestamp value) {
public LocalDateTime toJavaType(Column column, Class<?> entityType, Timestamp value) {
return value == null ? null : value.toLocalDateTime();
}

Expand Down
Expand Up @@ -41,7 +41,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> Long toJavaType(Column column, Class<ENTITY> entityType, Timestamp value) {
public Long toJavaType(Column column, Class<?> entityType, Timestamp value) {
return value == null ? null : value.getTime();
}

Expand Down
Expand Up @@ -43,7 +43,7 @@ public Type getJavaType(Column column) {
}

@Override
public <ENTITY> T toJavaType(Column column, Class<ENTITY> entityType, T value) {
public T toJavaType(Column column, Class<?> entityType, T value) {
return value;
}

Expand Down

0 comments on commit 96cc216

Please sign in to comment.