Does aggregate function "greatest" work on entity objects?
do not come to the function "compareTo"
@Entity public class ChatHistoryItem extends AbstractObject implements Comparable { private static final long serialVersionUID = 1L; @Override public int compareTo(Object t) { //Logger.getLogger("------------").log(Level.INFO, this.toString() + " compareTo " + t.toString() + " result = " + int result = ((int)(this.getCreateDate().getTime() - ((ChatHistoryItem)t).getCreateDate().getTime())); //Logger.getLogger("------------").log(Level.INFO, this.toString() + " compareTo " + t.toString() + " result = " + result); return result; } @Column(length=1024) private String text; @Embedded private PersonData sender; @Embedded private PersonData recipient; @ElementCollection(targetClass = ChatAttachment.class, fetch = FetchType.EAGER) private List<ChatAttachment> attachments; private boolean isSystem; private boolean isViewed; private boolean isPriority; public String getText() { return text; } public void setText(String text) { this.text = text; } public PersonData getSender() { return sender; } public void setSender(PersonData sender) { this.sender = sender; } public PersonData getRecipient() { return recipient; } public void setRecipient(PersonData recipient) { this.recipient = recipient; } public List<ChatAttachment> getAttachments() { return attachments; } public void setAttachments(List<ChatAttachment> attachments) { this.attachments = attachments; } public boolean getIsSystem() { return isSystem; } public void setIsSystem(boolean isSystem) { this.isSystem = isSystem; } public boolean getIsViewed() { return isViewed; } public void setIsViewed(boolean isViewed) { this.isViewed = isViewed; } public boolean isIsPriority() { return isPriority; } public void setIsPriority(boolean isPriority) { this.isPriority = isPriority; } @Override public String toString() { return "granat.dp.domain.entity.DialogItem[ id=" + getId() + " ]"; } }
Thanks for your help.