[ 
https://issues.apache.org/jira/browse/METAMODEL-145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14567050#comment-14567050
 ] 

xialvjun commented on METAMODEL-145:
------------------------------------

Assume a Class Person has String name, Integer age, String sex 3 properties.  
Can TypedColumn<Person> mean [TypedColumn<String>, TypedColumn<Integer>, 
TypedColumn<String>].   Then if I set a filter where(TypedColumn<Person> == 
Person p), it means where(TypedColumn<String> == String 
pname).and(TypedColumn<Integer> == Integer page).and(TypedColumn<String> == 
String psex)......balabalabala.....

Also, we can group by the TypedColumn<Person>

> A Column subinterface with type arguments
> -----------------------------------------
>
>                 Key: METAMODEL-145
>                 URL: https://issues.apache.org/jira/browse/METAMODEL-145
>             Project: Apache MetaModel
>          Issue Type: New Feature
>            Reporter: Kasper Sørensen
>
> I propose to introduce a new interface to extend the Column interface. This 
> interface should have a type parameter, representing the value type of the 
> column. My suggested name would be TypedColumn<E>.
> To take advantage of this type information I propose a few changes:
> DataSet: Add a getValue(TypedColumn) method. When you have a typed column you 
> can then get values from DataSets that do not need casting:
> {code}
> TypedColumn<Boolean> c1 = ...
> TypedColumn<String> c2 = ...
> DataSet ds = ...
> Boolean value1 = ds.getValue(c1);
> Boolean value2 = ds.getValue(c2);
> {code}
> Table: Change the return type of getNumberColumns() to return TypedColumn<? 
> extends Number>[] instead of just Column[]. Apply same principle to other 
> such methods (getBooleanColumns, getLiteralColumns etc.).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to