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
Hope another AbstractFunction in dynamic sql can be improved in new release.
class AbstractFunction<T, U extends AbstractFunction<T, U>>
This generic constraint greatly limits AbstractFunction. Because it requires that the type of function returned has the same the type as incoming column.
consider mysql st_distance function, input type is point ( as byte array in Mybatis ), and return double, so AbstractFunction cant be used.
A simple solution to fix that is add a generic parameter and use inheritance to be compatible with existing code:
class ComputeFunction<TInput, TOutput, U extends AbstractFunction<TInput, TOutput, U>>
class AbstractFunction<T, U extends AbstractFunction<T, U>> : ComputeFunction<T, T, U extends ComputeFunction<T, T, U>>
thanks !
The text was updated successfully, but these errors were encountered:
Hope another AbstractFunction in dynamic sql can be improved in new release.
This generic constraint greatly limits AbstractFunction. Because it requires that the type of function returned has the same the type as incoming column.
consider mysql st_distance function, input type is point ( as byte array in Mybatis ), and return double, so AbstractFunction cant be used.
A simple solution to fix that is add a generic parameter and use inheritance to be compatible with existing code:
thanks !
The text was updated successfully, but these errors were encountered: