我有一个从 BeanItemContainer 扩展的 Container 类。我想将 ItemSorter 添加到 DATE_CREATED 属性以按降序对值进行排序。
容器类。
public class NoteContainer extends BeanItemContainer<CaseNote> implements Serializable
{
private static final long serialVersionUID = -5926608449530066014L;
public static final String DATE_CREATED = "dateCreated";
public static final String CREATED_BY = "createdBy";
public static final String TEXT = "text";
public static final String ACTION = "Action";
public static final Object[] NATURAL_COL_ORDER = new Object[] {
ACTION, DATE_CREATED, CREATED_BY, TEXT
};
public static final String[] COL_HEADERS_ENGLISH = new String[] {
"ACTION", "Date Created/Updated", "Created/Updated By", "Note"
};
/**
* Default Constructor.
*
*/
public NoteContainer()
{
super(CaseNote.class);
}
}
CaseNote 是一个实体类,里面DATE_CREATED
是java.util.Date
格式。
请提供适当的解决方案...
提前谢谢。