CCM NG: Added OrderBy annotation to several lists
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5172 8810af33-2d31-482b-a856-94f89814c4df
parent
fd3730bb9d
commit
5215362d4a
|
|
@ -41,6 +41,7 @@ import javax.persistence.JoinTable;
|
|||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OrderBy;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
|
@ -416,6 +417,7 @@ public class Asset extends CcmObject {
|
|||
private static final long serialVersionUID = -3499741368562653529L;
|
||||
|
||||
@OneToMany(mappedBy = "asset")
|
||||
@OrderBy("sortKey ASC")
|
||||
private List<ItemAttachment<?>> itemAttachments;
|
||||
|
||||
@Embedded
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import javax.persistence.ManyToOne;
|
|||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OrderBy;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
|
@ -140,6 +141,7 @@ public class AttachmentList implements Comparable<AttachmentList>,
|
|||
private LocalizedString description;
|
||||
|
||||
@OneToMany(mappedBy = "attachmentList")
|
||||
@OrderBy("sortKey ASC")
|
||||
@RecursivePermissions(privileges = {AssetPrivileges.EDIT,
|
||||
AssetPrivileges.DELETE,
|
||||
AssetPrivileges.VIEW})
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ import javax.persistence.FetchType;
|
|||
import org.hibernate.envers.NotAudited;
|
||||
import org.librecms.contentsection.privileges.ItemPrivileges;
|
||||
|
||||
import javax.persistence.OrderBy;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
/**
|
||||
|
|
@ -586,6 +588,7 @@ public class ContentItem extends CcmObject implements Serializable {
|
|||
private String ancestors;
|
||||
|
||||
@OneToMany(mappedBy = "item", fetch = FetchType.LAZY)
|
||||
@OrderBy("order ASC")
|
||||
private List<AttachmentList> attachments;
|
||||
|
||||
@OneToOne()
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ import org.librecms.contentsection.privileges.ItemPrivileges;
|
|||
import org.librecms.contentsection.privileges.TypePrivileges;
|
||||
import org.librecms.lifecycle.LifecycleDefinition;
|
||||
|
||||
import javax.persistence.OrderBy;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
/**
|
||||
|
|
@ -180,6 +182,7 @@ public class ContentSection extends CcmApplication implements Serializable {
|
|||
private Locale defaultLocale;
|
||||
|
||||
@OneToMany(mappedBy = "contentSection")
|
||||
@OrderBy("contentItemClass ASC")
|
||||
private List<ContentType> contentTypes = new ArrayList<>();
|
||||
|
||||
@OneToMany
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import javax.persistence.Entity;
|
|||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OrderBy;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
|
@ -90,6 +91,7 @@ public class MultiPartArticle extends ContentItem implements Serializable {
|
|||
|
||||
@OneToMany
|
||||
@JoinColumn(name = "MULTIPART_ARTICLE_ID")
|
||||
@OrderBy("rank ASC")
|
||||
private List<MultiPartArticleSection> sections;
|
||||
|
||||
public MultiPartArticle() {
|
||||
|
|
|
|||
|
|
@ -227,6 +227,7 @@ public class Category extends CcmObject implements Serializable, Portable {
|
|||
*/
|
||||
@RecursivePermissions
|
||||
@OneToMany(mappedBy = "category", fetch = FetchType.LAZY)
|
||||
@OrderBy("objectOrder ASC")
|
||||
@XmlElementWrapper(name = "objects", namespace = CAT_XML_NS)
|
||||
@JsonIgnore
|
||||
private List<Categorization> objects;
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ public class CcmObject implements Identifiable, Serializable {
|
|||
* Permissions granted on this object.
|
||||
*/
|
||||
@OneToMany(mappedBy = "object", fetch = FetchType.LAZY)
|
||||
@OrderBy("grantedPrivilege ASC")
|
||||
@IndexedEmbedded(includePaths = {"grantedPrivilege", "grantee.name"})
|
||||
@XmlElementWrapper(name = "permissions", namespace = CORE_XML_NS)
|
||||
@XmlElement(name = "permission", namespace = CORE_XML_NS)
|
||||
|
|
@ -123,6 +124,7 @@ public class CcmObject implements Identifiable, Serializable {
|
|||
* Categories which have been assigned to this {@code CcmObject}.
|
||||
*/
|
||||
@OneToMany(mappedBy = "categorizedObject", fetch = FetchType.LAZY)
|
||||
@OrderBy("categoryOrder ASC")
|
||||
@XmlElementWrapper(name = "categories", namespace = CORE_XML_NS)
|
||||
@XmlElement(name = "category", namespace = CORE_XML_NS)
|
||||
@JsonIgnore
|
||||
|
|
|
|||
|
|
@ -21,12 +21,19 @@ package org.libreccm.formbuilder;
|
|||
import org.libreccm.core.CcmObject;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.DB_SCHEMA;
|
||||
|
||||
import javax.persistence.AssociationOverride;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import javax.persistence.Column;
|
|||
import javax.persistence.Entity;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
|
@ -29,6 +30,8 @@ import java.util.Objects;
|
|||
|
||||
import static org.libreccm.core.CoreConstants.DB_SCHEMA;
|
||||
|
||||
import javax.persistence.OrderBy;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
@ -52,6 +55,7 @@ public class Widget extends Component implements Serializable {
|
|||
// private WidgetLabel label;
|
||||
|
||||
@OneToMany(mappedBy = "widget")
|
||||
@OrderBy("className ASC")
|
||||
private List<Listener> listeners;
|
||||
|
||||
public String getParameterName() {
|
||||
|
|
|
|||
|
|
@ -69,9 +69,11 @@ public class Message extends CcmObject implements Serializable {
|
|||
private Message inReplyTo;
|
||||
|
||||
@OneToMany(mappedBy = "inReplyTo")
|
||||
@OrderBy("sent ASC")
|
||||
private List<Message> replies;
|
||||
|
||||
@OneToMany(mappedBy = "message")
|
||||
@OrderBy("title ASC")
|
||||
private List<Attachment> attachments;
|
||||
|
||||
public User getSender() {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ import javax.persistence.ManyToOne;
|
|||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OrderBy;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
|
|
@ -240,6 +241,7 @@ public class PageModel implements Serializable {
|
|||
* The components of the page described by this {@code PageModel}.
|
||||
*/
|
||||
@OneToMany(mappedBy = "pageModel")
|
||||
@OrderBy("key ASC")
|
||||
private List<ComponentModel> components;
|
||||
|
||||
public PageModel() {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import javax.persistence.Column;
|
|||
import javax.persistence.Entity;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
@ -31,6 +32,8 @@ import java.util.List;
|
|||
|
||||
import static org.libreccm.core.CoreConstants.DB_SCHEMA;
|
||||
|
||||
import javax.persistence.OrderBy;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
@ -45,6 +48,7 @@ public class Portal extends Resource implements Serializable {
|
|||
private boolean template;
|
||||
|
||||
@OneToMany(mappedBy = "portal")
|
||||
@OrderBy("cellNumber ASC, sortKey ASC")
|
||||
private List<Portlet> portlets;
|
||||
|
||||
public Portal() {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public class Initalizer implements Serializable {
|
|||
private String className;
|
||||
|
||||
@ManyToOne
|
||||
@OrderBy("className ASC")
|
||||
@JoinColumn(name = "REQUIRED_BY_ID")
|
||||
private Initalizer requiredBy;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,19 +23,29 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
|||
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
||||
import org.libreccm.portation.Portable;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElementWrapper;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.CORE_XML_NS;
|
||||
import static org.libreccm.core.CoreConstants.DB_SCHEMA;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.NamedAttributeNode;
|
||||
import javax.persistence.NamedEntityGraph;
|
||||
import javax.persistence.NamedEntityGraphs;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.NamedSubgraph;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* A group is basically a collection of users.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ public class Role implements Serializable, Portable {
|
|||
* Permissions granted to the role.
|
||||
*/
|
||||
@OneToMany(mappedBy = "grantee")
|
||||
@OrderBy("grantedPrivilege ASC")
|
||||
@XmlElementWrapper(name = "permissions", namespace = CORE_XML_NS)
|
||||
@XmlElement(name = "permission", namespace = CORE_XML_NS)
|
||||
@JsonIgnore
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import javax.persistence.Entity;
|
|||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OrderBy;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
|
|
@ -94,6 +95,7 @@ public class Site extends CcmObject {
|
|||
* The applications mapped to this site.
|
||||
*/
|
||||
@OneToMany(mappedBy = "site")
|
||||
@OrderBy("primaryUrl")
|
||||
private List<SiteAwareApplication> applications;
|
||||
|
||||
public Site() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue