Open kfyty opened 8 months ago
We expect the selected column to have the proper column name, not the property name, which I think is correct since we are on the database side of things.
Making this more lenient might seem nice at first but might trigger more problems. For example when there are properties propertyname
and propertyName
and one wants to select only propertyname
, then propertyName
will get assigned the same value.
While this is a somewhat contrived example I think it demonstrates the conceptual problem of not keeping column names apart.
One could envision some kind of special syntax to make mapping more easy like for example $col(<propertyPath>)$
, which could also properly handle embedded entities and similar which currently are kind of difficult to get right.
We expect the selected column to have the proper column name, not the property name, which I think is correct since we are on the database side of things.
Making this more lenient might seem nice at first but might trigger more problems. For example when there are properties
propertyname
andpropertyName
and one wants to select onlypropertyname
, thenpropertyName
will get assigned the same value.While this is a somewhat contrived example I think it demonstrates the conceptual problem of not keeping column names apart.
One could envision some kind of special syntax to make mapping more easy like for example
$col(<propertyPath>)$
, which could also properly handle embedded entities and similar which currently are kind of difficult to get right.
Okay, but in my unit testing, when there are properties propertyname and propertyName and one wants to select only propertyname, the result of propertyName is null, it will not assigned the same value.
When the field alias in SQL is equal to the field name in the class, the property value in the class will be null. This submission has fixed this issue. eg: the class:
the interface:
the query result of getById(id) is: id=1,fansNum = null.