You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// GENERATED BY S3LM4@org.springframework.stereotype.Service("")
publicfinalclassRecordMapperSelmaGeneratedClassimplementsRecordMapper {
@OverridepublicfinalRecordsDAOasRecordsDAO(RecordsinRecords) {
demo.RecordsDAOout = null;
if (inRecords != null) {
out = newdemo.RecordsDAO();
out.setSpeed(asValue(inRecords.getSpeed()));
out.setType(asValue(inRecords.getType()));
}
returnout;
}
publicfinalValue<String> asValue(Value<String> inString) {
demo.Value<java.lang.String> out = null;
if (inString != null) {
out = newdemo.Value<java.lang.String>();
out.setUnit(inString.getUnit());
out.setValue(inString.getValue());
}
returnout;
}
publicfinalValue<Double> asValue(Value<Double> inDouble) {
demo.Value<java.lang.Double> out = null;
if (inDouble != null) {
out = newdemo.Value<java.lang.Double>();
out.setUnit(inDouble.getUnit());
out.setValue(inDouble.getValue());
}
returnout;
}
/** * Single constructor */publicRecordMapperSelmaGeneratedClass() {
}
}
The above conversion complains that,
SelmaRecordMapperSelmaGeneratedClass.java:[30,30] name clash: asValue(Value<java.lang.Double>) and asValue(Value<java.lang.String>) have the same erasure
This can be solved by adding CustomMapper but i've many such fields and dataTypes which clashes, so do we have a simple solution to this kind of problem?
for eg, instead of generating method name asValue(), can it also include the dataType along?
like asValueDouble(), asValueString() which can help in differentiating the methods?
The text was updated successfully, but these errors were encountered:
Hi, I've just commited a fix extending the name of the generated in such case.
It will not work in all cases because the type argument is not properly resolved but it should work for you.
Hi,
I'm using Selma 1.0 and I'm getting type-erasure error for the below mapping.
There's a simple generic class,
And I'm using the above class with multiple fields, which looks like,
And my mapper is,
And here is the Selma generated Class,
The above conversion complains that,
SelmaRecordMapperSelmaGeneratedClass.java:[30,30] name clash: asValue(Value<java.lang.Double>) and asValue(Value<java.lang.String>) have the same erasure
This can be solved by adding CustomMapper but i've many such fields and dataTypes which clashes, so do we have a simple solution to this kind of problem?
for eg, instead of generating method name asValue(), can it also include the dataType along?
like asValueDouble(), asValueString() which can help in differentiating the methods?
The text was updated successfully, but these errors were encountered: