CCM NG: Some fixes on database object identifiers like tables etc on ensure compatibility with H2, PostgreSQL and Oracle
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3606 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
47ac2a9d43
commit
0e35c7b723
|
|
@ -262,7 +262,7 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<dialects>
|
<dialects>
|
||||||
<param>h2</param>
|
<param>h2</param>
|
||||||
<param>mysql5_innodb</param>
|
<!--<param>mysql5_innodb</param>-->
|
||||||
<param>oracle10g</param>
|
<param>oracle10g</param>
|
||||||
<param>postgresql9</param>
|
<param>postgresql9</param>
|
||||||
</dialects>
|
</dialects>
|
||||||
|
|
@ -593,8 +593,8 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<dialects>
|
<dialects>
|
||||||
<param>h2</param>
|
<param>h2</param>
|
||||||
<param>mysql5_innodb</param>
|
|
||||||
<param>postgresql9</param>
|
<param>postgresql9</param>
|
||||||
|
<param>oracle10g</param>
|
||||||
</dialects>
|
</dialects>
|
||||||
<packages>
|
<packages>
|
||||||
<param>org.libreccm</param>
|
<param>org.libreccm</param>
|
||||||
|
|
|
||||||
|
|
@ -38,13 +38,13 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ccm_revisions", schema = DB_SCHEMA)
|
@Table(name = "CCM_REVISIONS", schema = DB_SCHEMA)
|
||||||
@RevisionEntity()
|
@RevisionEntity()
|
||||||
public class CcmRevision extends DefaultRevisionEntity {
|
public class CcmRevision extends DefaultRevisionEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3458682765535922544L;
|
private static final long serialVersionUID = -3458682765535922544L;
|
||||||
|
|
||||||
@Column(name = "user_name")
|
@Column(name = "USER_NAME")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
public String getUserName() {
|
public String getUserName() {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ import javax.persistence.JoinColumn;
|
||||||
* @apiviz.has org.libreccm.core.CcmObject
|
* @apiviz.has org.libreccm.core.CcmObject
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "categorizations", schema = DB_SCHEMA)
|
@Table(name = "CATEGORIZATIONS", schema = DB_SCHEMA)
|
||||||
public class Categorization implements Serializable {
|
public class Categorization implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 201504301320L;
|
private static final long serialVersionUID = 201504301320L;
|
||||||
|
|
@ -55,7 +55,7 @@ public class Categorization implements Serializable {
|
||||||
* The ID of the categorisation object.
|
* The ID of the categorisation object.
|
||||||
*/
|
*/
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "categorization_id")
|
@Column(name = "CATEGORIZATION_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long categorizationId;
|
private long categorizationId;
|
||||||
|
|
||||||
|
|
@ -63,35 +63,35 @@ public class Categorization implements Serializable {
|
||||||
* The category to which this {@code Categorization} object belongs.
|
* The category to which this {@code Categorization} object belongs.
|
||||||
*/
|
*/
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "category_id")
|
@JoinColumn(name = "CATEGORY_ID")
|
||||||
private Category category;
|
private Category category;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The categorised object.
|
* The categorised object.
|
||||||
*/
|
*/
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "object_id")
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
private CcmObject categorizedObject;
|
private CcmObject categorizedObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the categorised object is the index object of the category this
|
* If the categorised object is the index object of the category this
|
||||||
* property is set to {@code true}.
|
* property is set to {@code true}.
|
||||||
*/
|
*/
|
||||||
@Column(name = "category_index")
|
@Column(name = "CATEGORY_INDEX")
|
||||||
private boolean index;
|
private boolean index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the order in which the categories assigned the the categorised
|
* Defines the order in which the categories assigned the the categorised
|
||||||
* object are shown.
|
* object are shown.
|
||||||
*/
|
*/
|
||||||
@Column(name = "category_order")
|
@Column(name = "CATEGORY_ORDER")
|
||||||
private long categoryOrder;
|
private long categoryOrder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the order in which the objects assigned to the category are
|
* Defines the order in which the objects assigned to the category are
|
||||||
* shown.
|
* shown.
|
||||||
*/
|
*/
|
||||||
@Column(name = "object_order")
|
@Column(name = "OBJECT_ORDER")
|
||||||
private long objectOrder;
|
private long objectOrder;
|
||||||
|
|
||||||
public long getCategorizationId() {
|
public long getCategorizationId() {
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ import javax.validation.constraints.Pattern;
|
||||||
* @apiviz.composedOf org.libreccm.categorization.Categorization
|
* @apiviz.composedOf org.libreccm.categorization.Categorization
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "categories", schema = DB_SCHEMA)
|
@Table(name = "CATEGORIES", schema = DB_SCHEMA)
|
||||||
@NamedQueries({
|
@NamedQueries({
|
||||||
@NamedQuery(name = "topLevelCategories",
|
@NamedQuery(name = "topLevelCategories",
|
||||||
query = "SELECT c FROM Category c WHERE c.parentCategory IS NULL")
|
query = "SELECT c FROM Category c WHERE c.parentCategory IS NULL")
|
||||||
|
|
@ -74,14 +74,14 @@ public class Category extends CcmObject implements Serializable {
|
||||||
* A unique ID for the category. This ID will be the same even the same
|
* A unique ID for the category. This ID will be the same even the same
|
||||||
* category system/domain is used in different installations.
|
* category system/domain is used in different installations.
|
||||||
*/
|
*/
|
||||||
@Column(name = "unique_id", nullable = false)
|
@Column(name = "UNIQUE_ID", nullable = false)
|
||||||
private String uniqueId;
|
private String uniqueId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the category. This is used as URL stub, therefore only the
|
* The name of the category. This is used as URL stub, therefore only the
|
||||||
* characters a to z, A to Z and 0 to 9 are allowed.
|
* characters a to z, A to Z and 0 to 9 are allowed.
|
||||||
*/
|
*/
|
||||||
@Column(name = "name", nullable = false)
|
@Column(name = "NAME", nullable = false)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Pattern(regexp = "[\\w-.]*")
|
@Pattern(regexp = "[\\w-.]*")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
@ -91,11 +91,11 @@ public class Category extends CcmObject implements Serializable {
|
||||||
*/
|
*/
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "category_titles",
|
joinTable = @JoinTable(name = "CATEGORY_TITLES",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "object_id")}
|
@JoinColumn(name = "OBJECT_ID")}
|
||||||
))
|
))
|
||||||
private LocalizedString title;
|
private LocalizedString title;
|
||||||
|
|
||||||
|
|
@ -104,11 +104,11 @@ public class Category extends CcmObject implements Serializable {
|
||||||
*/
|
*/
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "category_descriptions",
|
joinTable = @JoinTable(name = "CATEGORY_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "object_id")}
|
@JoinColumn(name = "OBJECT_ID")}
|
||||||
))
|
))
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
|
|
@ -116,21 +116,21 @@ public class Category extends CcmObject implements Serializable {
|
||||||
* Defines if the category is enabled. If the category is <em>not</em>
|
* Defines if the category is enabled. If the category is <em>not</em>
|
||||||
* enabled, the category can't be used in any way.
|
* enabled, the category can't be used in any way.
|
||||||
*/
|
*/
|
||||||
@Column(name = "enabled")
|
@Column(name = "ENABLED")
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines if the category is visible. A category which is <em>not</em>
|
* Defines if the category is visible. A category which is <em>not</em>
|
||||||
* visible should be only visible in the backend but not in the frontend.
|
* visible should be only visible in the backend but not in the frontend.
|
||||||
*/
|
*/
|
||||||
@Column(name = "visible")
|
@Column(name = "VISIBLE")
|
||||||
private boolean visible;
|
private boolean visible;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines if the category is abstract. It is not possible to add objects to
|
* Defines if the category is abstract. It is not possible to add objects to
|
||||||
* an abstract category.
|
* an abstract category.
|
||||||
*/
|
*/
|
||||||
@Column(name = "abstract_category")
|
@Column(name = "ABSTRACT_CATEGORY")
|
||||||
private boolean abstractCategory;
|
private boolean abstractCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -150,13 +150,13 @@ public class Category extends CcmObject implements Serializable {
|
||||||
* of domain every category has a parent category.
|
* of domain every category has a parent category.
|
||||||
*/
|
*/
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "parent_category_id")
|
@JoinColumn(name = "PARENT_CATEGORY_ID")
|
||||||
private Category parentCategory;
|
private Category parentCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Numeric value to define the order of the categories.
|
* Numeric value to define the order of the categories.
|
||||||
*/
|
*/
|
||||||
@Column(name = "category_order")
|
@Column(name = "CATEGORY_ORDER")
|
||||||
private long categoryOrder;
|
private long categoryOrder;
|
||||||
|
|
||||||
public Category() {
|
public Category() {
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "category_domains", schema = DB_SCHEMA)
|
@Table(name = "CATEGORY_DOMAINS", schema = DB_SCHEMA)
|
||||||
@XmlRootElement(name = "domain", namespace = CAT_XML_NS)
|
@XmlRootElement(name = "domain", namespace = CAT_XML_NS)
|
||||||
public class Domain extends CcmObject implements Serializable {
|
public class Domain extends CcmObject implements Serializable {
|
||||||
|
|
||||||
|
|
@ -84,7 +84,7 @@ public class Domain extends CcmObject implements Serializable {
|
||||||
* without special characters or spaces, for example {@code APLAWS-NAV} or
|
* without special characters or spaces, for example {@code APLAWS-NAV} or
|
||||||
* {@code MYNAV}.
|
* {@code MYNAV}.
|
||||||
*/
|
*/
|
||||||
@Column(name = "domain_key", nullable = false, unique = true, length = 255)
|
@Column(name = "DOMAIN_KEY", nullable = false, unique = true, length = 255)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Pattern(regexp = "[\\w-.]*")
|
@Pattern(regexp = "[\\w-.]*")
|
||||||
@XmlElement(name = "domain-key", namespace = CAT_XML_NS)
|
@XmlElement(name = "domain-key", namespace = CAT_XML_NS)
|
||||||
|
|
@ -102,7 +102,7 @@ public class Domain extends CcmObject implements Serializable {
|
||||||
* http://example.org/domains/example-nav
|
* http://example.org/domains/example-nav
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
@Column(name = "uri", nullable = false, unique = true, length = 1024)
|
@Column(name = "URI", nullable = false, unique = true, length = 1024)
|
||||||
@Convert(converter = UriConverter.class)
|
@Convert(converter = UriConverter.class)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@URL
|
@URL
|
||||||
|
|
@ -115,11 +115,11 @@ public class Domain extends CcmObject implements Serializable {
|
||||||
*/
|
*/
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "domain_titles",
|
joinTable = @JoinTable(name = "DOMAIN_TITLES",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "object_id")}))
|
@JoinColumn(name = "OBJECT_ID")}))
|
||||||
@XmlElement(name = "title", namespace = CAT_XML_NS)
|
@XmlElement(name = "title", namespace = CAT_XML_NS)
|
||||||
private LocalizedString title;
|
private LocalizedString title;
|
||||||
|
|
||||||
|
|
@ -128,18 +128,18 @@ public class Domain extends CcmObject implements Serializable {
|
||||||
*/
|
*/
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "domain_descriptions",
|
joinTable = @JoinTable(name = "DOMAIN_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "object_id")}))
|
@JoinColumn(name = "OBJECT_ID")}))
|
||||||
@XmlElement(name = "description", namespace = CAT_XML_NS)
|
@XmlElement(name = "description", namespace = CAT_XML_NS)
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A version string for the {@code Domain}.
|
* A version string for the {@code Domain}.
|
||||||
*/
|
*/
|
||||||
@Column(name = "version", nullable = false)
|
@Column(name = "VERSION", nullable = false)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@XmlElement(name = "version", namespace = CAT_XML_NS)
|
@XmlElement(name = "version", namespace = CAT_XML_NS)
|
||||||
private String version;
|
private String version;
|
||||||
|
|
@ -147,7 +147,7 @@ public class Domain extends CcmObject implements Serializable {
|
||||||
/**
|
/**
|
||||||
* A timestamp for the release date of the {@code Domain}.
|
* A timestamp for the release date of the {@code Domain}.
|
||||||
*/
|
*/
|
||||||
@Column(name = "released")
|
@Column(name = "RELEASED")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
@XmlElement(name = "released", namespace = CAT_XML_NS)
|
@XmlElement(name = "released", namespace = CAT_XML_NS)
|
||||||
private Date released;
|
private Date released;
|
||||||
|
|
@ -156,7 +156,7 @@ public class Domain extends CcmObject implements Serializable {
|
||||||
* The root category of the domain.
|
* The root category of the domain.
|
||||||
*/
|
*/
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "root_category_id")
|
@JoinColumn(name = "ROOT_CATEGORY_ID")
|
||||||
@XmlElement(name = "root", namespace = CAT_XML_NS)
|
@XmlElement(name = "root", namespace = CAT_XML_NS)
|
||||||
private Category root;
|
private Category root;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ import org.libreccm.web.Application;
|
||||||
* @author <a href="jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "domain_ownerships", schema = DB_SCHEMA)
|
@Table(name = "DOMAIN_OWNERSHIPS", schema = DB_SCHEMA)
|
||||||
public class DomainOwnership implements Serializable {
|
public class DomainOwnership implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 201504301305L;
|
private static final long serialVersionUID = 201504301305L;
|
||||||
|
|
@ -54,7 +54,7 @@ public class DomainOwnership implements Serializable {
|
||||||
* The ID of this domain ownership.
|
* The ID of this domain ownership.
|
||||||
*/
|
*/
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "ownership_id")
|
@Column(name = "OWNERSHIP_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long ownershipId;
|
private long ownershipId;
|
||||||
|
|
||||||
|
|
@ -73,21 +73,21 @@ public class DomainOwnership implements Serializable {
|
||||||
/**
|
/**
|
||||||
* The context for the domain mapping.
|
* The context for the domain mapping.
|
||||||
*/
|
*/
|
||||||
@Column(name = "context")
|
@Column(name = "CONTEXT")
|
||||||
private String context;
|
private String context;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the order in which the owning {@link CcmObject}s of a
|
* Defines the order in which the owning {@link CcmObject}s of a
|
||||||
* {@link Domain} are shown.
|
* {@link Domain} are shown.
|
||||||
*/
|
*/
|
||||||
@Column(name = "owner_order")
|
@Column(name = "OWNER_ORDER")
|
||||||
private long ownerOrder;
|
private long ownerOrder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the order in which the {@link Domain}s owned by a
|
* Defines the order in which the {@link Domain}s owned by a
|
||||||
* {@link CcmObject} are shown.
|
* {@link CcmObject} are shown.
|
||||||
*/
|
*/
|
||||||
@Column(name = "domain_order")
|
@Column(name = "DOMAIN_ORDER")
|
||||||
private long domainOrder;
|
private long domainOrder;
|
||||||
|
|
||||||
public long getOwnershipId() {
|
public long getOwnershipId() {
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ccm_objects", schema = DB_SCHEMA)
|
@Table(name = "CCM_OBJECTS", schema = DB_SCHEMA)
|
||||||
@Inheritance(strategy = InheritanceType.JOINED)
|
@Inheritance(strategy = InheritanceType.JOINED)
|
||||||
@XmlRootElement(name = "ccm-object", namespace = CORE_XML_NS)
|
@XmlRootElement(name = "ccm-object", namespace = CORE_XML_NS)
|
||||||
//False warning (?). Because this class has been migrated from the old PDL style
|
//False warning (?). Because this class has been migrated from the old PDL style
|
||||||
|
|
@ -77,7 +77,7 @@ public class CcmObject implements Serializable {
|
||||||
* necessary to define an additional ID on classes which extend this class.
|
* necessary to define an additional ID on classes which extend this class.
|
||||||
*/
|
*/
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "object_id")
|
@Column(name = "OBJECT_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@XmlElement(name = "object-id", namespace = CORE_XML_NS)
|
@XmlElement(name = "object-id", namespace = CORE_XML_NS)
|
||||||
private long objectId;
|
private long objectId;
|
||||||
|
|
@ -85,7 +85,7 @@ public class CcmObject implements Serializable {
|
||||||
/**
|
/**
|
||||||
* A human readable name identifying this {@code CcmObject}
|
* A human readable name identifying this {@code CcmObject}
|
||||||
*/
|
*/
|
||||||
@Column(name = "display_name")
|
@Column(name = "DISPLAY_NAME")
|
||||||
@XmlElement(name = "display-name", namespace = CORE_XML_NS)
|
@XmlElement(name = "display-name", namespace = CORE_XML_NS)
|
||||||
private String displayName;
|
private String displayName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,7 @@ public final class CoreConstants {
|
||||||
|
|
||||||
public static final String CORE_XML_NS = "http://core.libreccm.org";
|
public static final String CORE_XML_NS = "http://core.libreccm.org";
|
||||||
|
|
||||||
public static final String DB_SCHEMA = "ccm_core";
|
public static final String DB_SCHEMA = "CCM_CORE";
|
||||||
|
|
||||||
public static final String SEQUENCE_GENERATOR = "core_core_sequence";
|
|
||||||
|
|
||||||
private CoreConstants() {
|
private CoreConstants() {
|
||||||
//Nothing
|
//Nothing
|
||||||
|
|
|
||||||
|
|
@ -50,17 +50,17 @@ public class EmailAddress implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4076089589412432766L;
|
private static final long serialVersionUID = -4076089589412432766L;
|
||||||
|
|
||||||
@Column(name = "email_address", length = 512, nullable = false)
|
@Column(name = "EMAIL_ADDRESS", length = 512, nullable = false)
|
||||||
@XmlElement(name = "address", namespace = CORE_XML_NS, required = true)
|
@XmlElement(name = "address", namespace = CORE_XML_NS, required = true)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Email
|
@Email
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@Column(name = "bouncing")
|
@Column(name = "BOUNCING")
|
||||||
@XmlElement(name = "bouncing", namespace = CORE_XML_NS)
|
@XmlElement(name = "bouncing", namespace = CORE_XML_NS)
|
||||||
private boolean bouncing;
|
private boolean bouncing;
|
||||||
|
|
||||||
@Column(name = "verified")
|
@Column(name = "VERIFIED")
|
||||||
@XmlElement(name = "verified", namespace = CORE_XML_NS)
|
@XmlElement(name = "verified", namespace = CORE_XML_NS)
|
||||||
private boolean verified;
|
private boolean verified;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ccm_groups", schema = DB_SCHEMA)
|
@Table(name = "CCM_GROUPS", schema = DB_SCHEMA)
|
||||||
@NamedQueries({
|
@NamedQueries({
|
||||||
@NamedQuery(name = "findGroupByName",
|
@NamedQuery(name = "findGroupByName",
|
||||||
query = "SELECT g FROM Group g WHERE g.name = :groupName")
|
query = "SELECT g FROM Group g WHERE g.name = :groupName")
|
||||||
|
|
@ -59,7 +59,7 @@ public class Group extends Subject implements Serializable {
|
||||||
/**
|
/**
|
||||||
* The name of the {@code Group}. Must be unique.
|
* The name of the {@code Group}. Must be unique.
|
||||||
*/
|
*/
|
||||||
@Column(name = "name", length = 512, unique = true, nullable = false)
|
@Column(name = "NAME", length = 512, unique = true, nullable = false)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@XmlElement(name = "name", namespace = CORE_XML_NS)
|
@XmlElement(name = "name", namespace = CORE_XML_NS)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
|
||||||
|
|
@ -40,14 +40,14 @@ import javax.xml.bind.annotation.XmlTransient;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "group_memberships", schema = DB_SCHEMA)
|
@Table(name = "GROUP_MEMBERSHIPS", schema = DB_SCHEMA)
|
||||||
@XmlRootElement(name = "group-membership", namespace = CORE_XML_NS)
|
@XmlRootElement(name = "group-membership", namespace = CORE_XML_NS)
|
||||||
public class GroupMembership implements Serializable {
|
public class GroupMembership implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1897274442468035089L;
|
private static final long serialVersionUID = 1897274442468035089L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "membership_id")
|
@Column(name = "MEMBERSHIP_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@XmlElement(name = "membership-id", namespace = CORE_XML_NS)
|
@XmlElement(name = "membership-id", namespace = CORE_XML_NS)
|
||||||
private long membershipId;
|
private long membershipId;
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "permissions", schema = DB_SCHEMA)
|
@Table(name = "PERMISSIONS", schema = DB_SCHEMA)
|
||||||
@NamedQueries({
|
@NamedQueries({
|
||||||
@NamedQuery(name = "findPermissionsForSubject",
|
@NamedQuery(name = "findPermissionsForSubject",
|
||||||
query = "SELECT p FROM Permission p WHERE p.grantee = :subject"),
|
query = "SELECT p FROM Permission p WHERE p.grantee = :subject"),
|
||||||
|
|
@ -100,7 +100,7 @@ public class Permission implements Serializable {
|
||||||
* The database id of the permission.
|
* The database id of the permission.
|
||||||
*/
|
*/
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "permission_id")
|
@Column(name = "PERMISSION_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@XmlElement(name = "permission-id", namespace = CORE_XML_NS)
|
@XmlElement(name = "permission-id", namespace = CORE_XML_NS)
|
||||||
private long permissionId;
|
private long permissionId;
|
||||||
|
|
@ -111,14 +111,14 @@ public class Permission implements Serializable {
|
||||||
* {@link User}s in that have the permission.
|
* {@link User}s in that have the permission.
|
||||||
*/
|
*/
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "grantee_id")
|
@JoinColumn(name = "GRANTEE_ID")
|
||||||
private Subject grantee;
|
private Subject grantee;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link Privilege} granted by this {@code Permission}.
|
* The {@link Privilege} granted by this {@code Permission}.
|
||||||
*/
|
*/
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "granted_privilege_id")
|
@JoinColumn(name = "GRANTED_PRIVILEGE_ID")
|
||||||
@XmlElement(name = "privilege", namespace = CORE_XML_NS)
|
@XmlElement(name = "privilege", namespace = CORE_XML_NS)
|
||||||
private Privilege grantedPrivilege;
|
private Privilege grantedPrivilege;
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ public class Permission implements Serializable {
|
||||||
* <strong>all</strong> objects.
|
* <strong>all</strong> objects.
|
||||||
*/
|
*/
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "object_id")
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
private CcmObject object;
|
private CcmObject object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -137,7 +137,7 @@ public class Permission implements Serializable {
|
||||||
* process.
|
* process.
|
||||||
*/
|
*/
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "creation_user_id")
|
@JoinColumn(name = "CREATION_USER_ID")
|
||||||
@XmlElement(name = "creation-user", namespace = CORE_XML_NS)
|
@XmlElement(name = "creation-user", namespace = CORE_XML_NS)
|
||||||
private User creationUser;
|
private User creationUser;
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ public class Permission implements Serializable {
|
||||||
* property can be {@code null} if this {@code Permission} was created by a
|
* property can be {@code null} if this {@code Permission} was created by a
|
||||||
* system process.
|
* system process.
|
||||||
*/
|
*/
|
||||||
@Column(name = "creation_date")
|
@Column(name = "CREATION_DATE")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
@XmlElement(name = "creation-date", namespace = CORE_XML_NS)
|
@XmlElement(name = "creation-date", namespace = CORE_XML_NS)
|
||||||
private Date creationDate;
|
private Date creationDate;
|
||||||
|
|
@ -156,7 +156,7 @@ public class Permission implements Serializable {
|
||||||
* property can be {@code null} if this {@code Permission} was created by a
|
* property can be {@code null} if this {@code Permission} was created by a
|
||||||
* system process.
|
* system process.
|
||||||
*/
|
*/
|
||||||
@Column(name = "creation_ip")
|
@Column(name = "CREATION_IP")
|
||||||
@XmlElement(name = "creation-ip", namespace = CORE_XML_NS)
|
@XmlElement(name = "creation-ip", namespace = CORE_XML_NS)
|
||||||
private String creationIp;
|
private String creationIp;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,25 +41,25 @@ public class PersonName implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5805626320605809172L;
|
private static final long serialVersionUID = -5805626320605809172L;
|
||||||
|
|
||||||
@Column(name = "title_pre", length = 512)
|
@Column(name = "TITLE_PRE", length = 512)
|
||||||
@XmlElement(name = "title-pre", namespace = CORE_XML_NS)
|
@XmlElement(name = "title-pre", namespace = CORE_XML_NS)
|
||||||
private String titlePre;
|
private String titlePre;
|
||||||
|
|
||||||
@Column(name = "given_name", length = 512)
|
@Column(name = "GIVEN_NAME", length = 512)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@XmlElement(name = "given-name", namespace = CORE_XML_NS)
|
@XmlElement(name = "given-name", namespace = CORE_XML_NS)
|
||||||
private String givenName;
|
private String givenName;
|
||||||
|
|
||||||
@Column(name = "middle_name", length = 512)
|
@Column(name = "MIDDLE_NAME", length = 512)
|
||||||
@XmlElement(name = "middle-name", namespace = CORE_XML_NS)
|
@XmlElement(name = "middle-name", namespace = CORE_XML_NS)
|
||||||
private String middleName;
|
private String middleName;
|
||||||
|
|
||||||
@Column(name = "family_name", length = 512)
|
@Column(name = "FAMILY_NAME", length = 512)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@XmlElement(name = "family-name", namespace = CORE_XML_NS)
|
@XmlElement(name = "family-name", namespace = CORE_XML_NS)
|
||||||
private String familyName;
|
private String familyName;
|
||||||
|
|
||||||
@Column(name = "title_post", length = 512)
|
@Column(name = "TITLE_POST", length = 512)
|
||||||
@XmlElement(name = "title-post", namespace = CORE_XML_NS)
|
@XmlElement(name = "title-post", namespace = CORE_XML_NS)
|
||||||
private String titlePost;
|
private String titlePost;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ccm_privileges", schema = DB_SCHEMA)
|
@Table(name = "CCM_PRIVILEGES", schema = DB_SCHEMA)
|
||||||
@NamedQueries({
|
@NamedQueries({
|
||||||
@NamedQuery(name = "findPrivilegeByName",
|
@NamedQuery(name = "findPrivilegeByName",
|
||||||
query = "SELECT p FROM Privilege p "
|
query = "SELECT p FROM Privilege p "
|
||||||
|
|
@ -58,7 +58,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
+ " JOIN p.grantedPrivilege g "
|
+ " JOIN p.grantedPrivilege g "
|
||||||
+ " WHERE g.label = :label")
|
+ " WHERE g.label = :label")
|
||||||
})
|
})
|
||||||
@XmlRootElement(name = "privilege", namespace = CORE_XML_NS)
|
@XmlRootElement(name = "PRIVILEGE", namespace = CORE_XML_NS)
|
||||||
public class Privilege implements Serializable {
|
public class Privilege implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3986038536996049440L;
|
private static final long serialVersionUID = -3986038536996049440L;
|
||||||
|
|
@ -73,7 +73,7 @@ public class Privilege implements Serializable {
|
||||||
* ID for the privilege.
|
* ID for the privilege.
|
||||||
*/
|
*/
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "privilege_id")
|
@Column(name = "PRIVILEGE_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@XmlElement(name = "privilege-id", namespace = CORE_XML_NS)
|
@XmlElement(name = "privilege-id", namespace = CORE_XML_NS)
|
||||||
private long privilegeId;
|
private long privilegeId;
|
||||||
|
|
@ -81,7 +81,7 @@ public class Privilege implements Serializable {
|
||||||
/**
|
/**
|
||||||
* The label of the {@code Privilege}.
|
* The label of the {@code Privilege}.
|
||||||
*/
|
*/
|
||||||
@Column(name = "label", length = 255, nullable = false, unique = true)
|
@Column(name = "LABEL", length = 255, nullable = false, unique = true)
|
||||||
@XmlElement(name = "label", namespace = CORE_XML_NS)
|
@XmlElement(name = "label", namespace = CORE_XML_NS)
|
||||||
private String label;
|
private String label;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ import javax.persistence.TemporalType;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "resources", schema = DB_SCHEMA)
|
@Table(name = "RESOURCES", schema = DB_SCHEMA)
|
||||||
public class Resource extends CcmObject implements Serializable {
|
public class Resource extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7345482620613842781L;
|
private static final long serialVersionUID = 7345482620613842781L;
|
||||||
|
|
@ -66,11 +66,11 @@ public class Resource extends CcmObject implements Serializable {
|
||||||
*/
|
*/
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "resource_titles",
|
joinTable = @JoinTable(name = "RESOURCE_TITLES",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "object_id")}))
|
@JoinColumn(name = "OBJECT_ID")}))
|
||||||
private LocalizedString title;
|
private LocalizedString title;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -78,11 +78,11 @@ public class Resource extends CcmObject implements Serializable {
|
||||||
*/
|
*/
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "resource_descriptions",
|
joinTable = @JoinTable(name = "RESOURCE_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "object_id")}))
|
@JoinColumn(name = "OBJECT_ID")}))
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
|
@ -91,7 +91,7 @@ public class Resource extends CcmObject implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Date on which the resource was created.
|
* Date on which the resource was created.
|
||||||
*/
|
*/
|
||||||
@Column(name = "created")
|
@Column(name = "CREATED")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date created;
|
private Date created;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ import org.libreccm.l10n.LocalizedString;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "resource_types", schema = DB_SCHEMA)
|
@Table(name = "RESOURCE_TYPES", schema = DB_SCHEMA)
|
||||||
@Inheritance(strategy = InheritanceType.JOINED)
|
@Inheritance(strategy = InheritanceType.JOINED)
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
"PMD.StdCyclomaticComplexity",
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
|
@ -53,31 +53,31 @@ public class ResourceType implements Serializable {
|
||||||
private static final long serialVersionUID = 4563584142251370627L;
|
private static final long serialVersionUID = 4563584142251370627L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "resource_type_id")
|
@Column(name = "RESOURCE_TYPE_ID")
|
||||||
private long resourceTypeId;
|
private long resourceTypeId;
|
||||||
|
|
||||||
@Column(name = "title", length = 254, nullable = false)
|
@Column(name = "TITLE", length = 254, nullable = false)
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "resource_type_descriptions",
|
joinTable = @JoinTable(name = "RESOURCE_TYPE_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "resource_type_id")}))
|
@JoinColumn(name = "RESOURCE_TYPE_ID")}))
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
@Column(name = "workspace_app")
|
@Column(name = "WORKSPACE_APP")
|
||||||
private boolean workspaceApplication;
|
private boolean workspaceApplication;
|
||||||
|
|
||||||
@Column(name = "full_page_view")
|
@Column(name = "FULL_PAGE_VIEW")
|
||||||
private boolean viewableAsFullPage;
|
private boolean viewableAsFullPage;
|
||||||
|
|
||||||
@Column(name = "embedded_view")
|
@Column(name = "EMBEDDED_VIEW")
|
||||||
private boolean viewableAsEmbedded;
|
private boolean viewableAsEmbedded;
|
||||||
|
|
||||||
@Column(name = "singleton")
|
@Column(name = "SINGLETON")
|
||||||
private boolean singleton;
|
private boolean singleton;
|
||||||
|
|
||||||
public ResourceType() {
|
public ResourceType() {
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ import javax.persistence.NamedQuery;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ccm_roles", schema = DB_SCHEMA)
|
@Table(name = "CCM_ROLES", schema = DB_SCHEMA)
|
||||||
@NamedQueries({
|
@NamedQueries({
|
||||||
@NamedQuery(name = "findRolesForName",
|
@NamedQuery(name = "findRolesForName",
|
||||||
query = "SELECT r FROM Role r "
|
query = "SELECT r FROM Role r "
|
||||||
|
|
@ -70,23 +70,23 @@ public class Role implements Serializable {
|
||||||
private static final long serialVersionUID = 3314358449751376350L;
|
private static final long serialVersionUID = 3314358449751376350L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "role_id")
|
@Column(name = "ROLE_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long roleId;
|
private long roleId;
|
||||||
|
|
||||||
@Column(name = "name", length = 512)
|
@Column(name = "NAME", length = 512)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "source_group_id")
|
@JoinColumn(name = "SOURCE_GROUP_ID")
|
||||||
private Group sourceGroup;
|
private Group sourceGroup;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "implicit_group_id")
|
@JoinColumn(name = "IMPLICIT_GROUP_ID")
|
||||||
private Group implicitGroup;
|
private Group implicitGroup;
|
||||||
|
|
||||||
@Column(name = "description")
|
@Column(name = "DESCRIPTION")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
public Role() {
|
public Role() {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "subjects", schema = DB_SCHEMA)
|
@Table(name = "SUBJECTS", schema = DB_SCHEMA)
|
||||||
@Inheritance(strategy = InheritanceType.JOINED)
|
@Inheritance(strategy = InheritanceType.JOINED)
|
||||||
@XmlRootElement(name = "subject", namespace = CORE_XML_NS)
|
@XmlRootElement(name = "subject", namespace = CORE_XML_NS)
|
||||||
public class Subject implements Serializable {
|
public class Subject implements Serializable {
|
||||||
|
|
@ -53,7 +53,7 @@ public class Subject implements Serializable {
|
||||||
private static final long serialVersionUID = 6303836654273293979L;
|
private static final long serialVersionUID = 6303836654273293979L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "subject_id")
|
@Column(name = "SUBJECT_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long subjectId;
|
private long subjectId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ import javax.xml.bind.annotation.XmlTransient;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ccm_users", schema = DB_SCHEMA)
|
@Table(name = "CCM_USERS", schema = DB_SCHEMA)
|
||||||
@NamedQueries({
|
@NamedQueries({
|
||||||
@NamedQuery(name = "findUserByScreenName",
|
@NamedQuery(name = "findUserByScreenName",
|
||||||
query = "SELECT u FROM User u WHERE u.screenName = :screenname"),
|
query = "SELECT u FROM User u WHERE u.screenName = :screenname"),
|
||||||
|
|
@ -81,11 +81,11 @@ public class User extends Subject implements Serializable {
|
||||||
*/
|
*/
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "user_names",
|
name = "USER_NAMES",
|
||||||
joinTable = @JoinTable(name = "user_names",
|
joinTable = @JoinTable(name = "USER_NAMES",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = " user_id")}))
|
@JoinColumn(name = "USER_ID")}))
|
||||||
@XmlElement(name = "person-name", namespace = CORE_XML_NS)
|
@XmlElement(name = "person-name", namespace = CORE_XML_NS)
|
||||||
private PersonName name;
|
private PersonName name;
|
||||||
|
|
||||||
|
|
@ -96,16 +96,16 @@ public class User extends Subject implements Serializable {
|
||||||
* the system if configured so, otherwise the email address of the user is
|
* the system if configured so, otherwise the email address of the user is
|
||||||
* used).
|
* used).
|
||||||
*/
|
*/
|
||||||
@Column(name = "screen_name", length = 255, nullable = false, unique = true)
|
@Column(name = "SCREEN_NAME", length = 255, nullable = false, unique = true)
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@XmlElement(name = "screen-name", namespace = CORE_XML_NS)
|
@XmlElement(name = "screen-name", namespace = CORE_XML_NS)
|
||||||
private String screenName;
|
private String screenName;
|
||||||
|
|
||||||
@ElementCollection(fetch = FetchType.EAGER)
|
@ElementCollection(fetch = FetchType.EAGER)
|
||||||
@CollectionTable(name = "user_email_addresses",
|
@CollectionTable(name = "USER_EMAIL_ADDRESSES",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "user_id")})
|
@JoinColumn(name = "USER_ID")})
|
||||||
@Size(min = 1)
|
@Size(min = 1)
|
||||||
@XmlElementWrapper(name = "email-addresses", namespace = CORE_XML_NS)
|
@XmlElementWrapper(name = "email-addresses", namespace = CORE_XML_NS)
|
||||||
@XmlElement(name = "email-address", namespace = CORE_XML_NS)
|
@XmlElement(name = "email-address", namespace = CORE_XML_NS)
|
||||||
|
|
@ -115,7 +115,7 @@ public class User extends Subject implements Serializable {
|
||||||
* A user can be banned which means that he or she can't login into the
|
* A user can be banned which means that he or she can't login into the
|
||||||
* system anymore.
|
* system anymore.
|
||||||
*/
|
*/
|
||||||
@Column(name = "banned")
|
@Column(name = "BANNED")
|
||||||
@XmlElement(name = "banned", namespace = CORE_XML_NS)
|
@XmlElement(name = "banned", namespace = CORE_XML_NS)
|
||||||
private boolean banned;
|
private boolean banned;
|
||||||
|
|
||||||
|
|
@ -123,21 +123,21 @@ public class User extends Subject implements Serializable {
|
||||||
* An alias for the user used in an another system for SSO, for example
|
* An alias for the user used in an another system for SSO, for example
|
||||||
* LDAP.
|
* LDAP.
|
||||||
*/
|
*/
|
||||||
@Column(name = "sso_login", length = 512)
|
@Column(name = "SSO_LOGIN", length = 512)
|
||||||
@XmlElement(name = "sso-login", namespace = CORE_XML_NS)
|
@XmlElement(name = "sso-login", namespace = CORE_XML_NS)
|
||||||
private String ssoLogin;
|
private String ssoLogin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The hashed password of the user.
|
* The hashed password of the user.
|
||||||
*/
|
*/
|
||||||
@Column(name = "password", length = 2048)
|
@Column(name = "PASSWORD", length = 2048)
|
||||||
@XmlTransient
|
@XmlTransient
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The salt used to hash the password.
|
* The salt used to hash the password.
|
||||||
*/
|
*/
|
||||||
@Column(name = "salt", length = 2048)
|
@Column(name = "SALT", length = 2048)
|
||||||
@XmlTransient
|
@XmlTransient
|
||||||
private String salt;
|
private String salt;
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ public class User extends Subject implements Serializable {
|
||||||
* administrator.
|
* administrator.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Column(name = "hash_algorithm", length = 64)
|
@Column(name = "HASH_ALGORITHM", length = 64)
|
||||||
@XmlTransient
|
@XmlTransient
|
||||||
private String hashAlgorithm;
|
private String hashAlgorithm;
|
||||||
|
|
||||||
|
|
@ -156,7 +156,7 @@ public class User extends Subject implements Serializable {
|
||||||
* Indicates that the user should be forced to change his or her password on
|
* Indicates that the user should be forced to change his or her password on
|
||||||
* the next login.
|
* the next login.
|
||||||
*/
|
*/
|
||||||
@Column(name = "password_reset_required")
|
@Column(name = "PASSWORD_RESET_REQUIRED")
|
||||||
//Can't shorten the name without making the name cryptic.
|
//Can't shorten the name without making the name cryptic.
|
||||||
@SuppressWarnings("PMD.LongVariable")
|
@SuppressWarnings("PMD.LongVariable")
|
||||||
private boolean passwordResetRequired;
|
private boolean passwordResetRequired;
|
||||||
|
|
@ -164,14 +164,14 @@ public class User extends Subject implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Question the recover a forgotten password.
|
* Question the recover a forgotten password.
|
||||||
*/
|
*/
|
||||||
@Column(name = "password_question", length = 2048)
|
@Column(name = "PASSWORD_QUESTION", length = 2048)
|
||||||
@XmlElement(name = "password-question", namespace = CORE_XML_NS)
|
@XmlElement(name = "password-question", namespace = CORE_XML_NS)
|
||||||
private String passwordQuestion;
|
private String passwordQuestion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Answer the the {@link #passwordQuestion}.
|
* Answer the the {@link #passwordQuestion}.
|
||||||
*/
|
*/
|
||||||
@Column(name = "password_answer", length = 2048)
|
@Column(name = "PASSWORD_ANSWER", length = 2048)
|
||||||
@XmlElement(name = "password-answer", namespace = CORE_XML_NS)
|
@XmlElement(name = "password-answer", namespace = CORE_XML_NS)
|
||||||
private String passwordAnswer;
|
private String passwordAnswer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.ServiceLoader;
|
import java.util.ServiceLoader;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
@ -111,9 +112,12 @@ public class CcmIntegrator implements Integrator {
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
|
|
||||||
switch (connection.getMetaData().getDatabaseProductName()) {
|
switch (connection.getMetaData().getDatabaseProductName()) {
|
||||||
case "MySQL":
|
case "H2":
|
||||||
buffer.append("/mysql");
|
buffer.append("/h2");
|
||||||
break;
|
break;
|
||||||
|
// case "MySQL":
|
||||||
|
// buffer.append("/mysql");
|
||||||
|
// break;
|
||||||
case "PostgreSQL":
|
case "PostgreSQL":
|
||||||
buffer.append("/pgsql");
|
buffer.append("/pgsql");
|
||||||
break;
|
break;
|
||||||
|
|
@ -160,7 +164,12 @@ public class CcmIntegrator implements Integrator {
|
||||||
|
|
||||||
final Flyway flyway = new Flyway();
|
final Flyway flyway = new Flyway();
|
||||||
flyway.setDataSource(dataSource);
|
flyway.setDataSource(dataSource);
|
||||||
flyway.setSchemas(getSchemaName(moduleInfo));
|
if ("H2".equals(connection.getMetaData().getDatabaseProductName())) {
|
||||||
|
flyway
|
||||||
|
.setSchemas(getSchemaName(moduleInfo).toUpperCase(Locale.ROOT));
|
||||||
|
} else {
|
||||||
|
flyway.setSchemas(getSchemaName(moduleInfo));
|
||||||
|
}
|
||||||
flyway.setLocations(getLocation(moduleInfo, connection));
|
flyway.setLocations(getLocation(moduleInfo, connection));
|
||||||
|
|
||||||
final MigrationInfo current = flyway.info().current();
|
final MigrationInfo current = flyway.info().current();
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ import static org.libreccm.core.CoreConstants.DB_SCHEMA;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "installed_modules", schema = DB_SCHEMA)
|
@Table(name = "INSTALLED_MODULES", schema = DB_SCHEMA)
|
||||||
public class InstalledModule implements Serializable {
|
public class InstalledModule implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6240025652113643164L;
|
private static final long serialVersionUID = 6240025652113643164L;
|
||||||
|
|
@ -46,13 +46,13 @@ public class InstalledModule implements Serializable {
|
||||||
* particular) accept long varchar fields as primary keys.
|
* particular) accept long varchar fields as primary keys.
|
||||||
*/
|
*/
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "module_id")
|
@Column(name = "MODULE_ID")
|
||||||
private int moduleId;
|
private int moduleId;
|
||||||
|
|
||||||
@Column(name = "module_class_name", length = 2048, unique = true)
|
@Column(name = "MODULE_CLASS_NAME", length = 2048, unique = true)
|
||||||
private String moduleClassName;
|
private String moduleClassName;
|
||||||
|
|
||||||
@Column(name = "status")
|
@Column(name = "STATUS")
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private ModuleStatus status;
|
private ModuleStatus status;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -255,15 +255,13 @@ public class ModuleInfo {
|
||||||
@SuppressWarnings(
|
@SuppressWarnings(
|
||||||
"PMD.LongVariable")
|
"PMD.LongVariable")
|
||||||
final boolean annotationHasPackageName = annotation.packageName()
|
final boolean annotationHasPackageName = annotation.packageName()
|
||||||
!= null
|
!= null
|
||||||
&& !annotation
|
&& !annotation
|
||||||
.packageName()
|
.packageName()
|
||||||
.isEmpty();
|
.isEmpty();
|
||||||
@SuppressWarnings("PMD.LongVariable")
|
@SuppressWarnings("PMD.LongVariable")
|
||||||
final boolean moduleInfoHasPackageName = moduleInfo
|
final boolean moduleInfoHasPackageName = moduleInfo
|
||||||
.getProperty(GROUP_ID)
|
.getProperty(GROUP_ID) != null && !moduleInfo.getProperty(
|
||||||
!= null
|
|
||||||
&& !moduleInfo.getProperty(
|
|
||||||
GROUP_ID).isEmpty();
|
GROUP_ID).isEmpty();
|
||||||
if (annotationHasPackageName) {
|
if (annotationHasPackageName) {
|
||||||
return annotation.packageName();
|
return annotation.packageName();
|
||||||
|
|
@ -271,7 +269,8 @@ public class ModuleInfo {
|
||||||
return String.format("%s/%s",
|
return String.format("%s/%s",
|
||||||
moduleInfo.getProperty(GROUP_ID),
|
moduleInfo.getProperty(GROUP_ID),
|
||||||
moduleInfo.
|
moduleInfo.
|
||||||
getProperty(ARTIFACT_ID));
|
getProperty(ARTIFACT_ID).replace("-",
|
||||||
|
"_"));
|
||||||
} else {
|
} else {
|
||||||
LOGGER.warn("The module data package was specified by the module "
|
LOGGER.warn("The module data package was specified by the module "
|
||||||
+ "annotation nore was an group id found in the module info"
|
+ "annotation nore was an group id found in the module info"
|
||||||
|
|
@ -291,7 +290,7 @@ public class ModuleInfo {
|
||||||
.isEmpty();
|
.isEmpty();
|
||||||
@SuppressWarnings("PMD.LongVariable")
|
@SuppressWarnings("PMD.LongVariable")
|
||||||
final boolean moduleInfoHasVersion = moduleInfo.getProperty(VERSION)
|
final boolean moduleInfoHasVersion = moduleInfo.getProperty(VERSION)
|
||||||
!= null
|
!= null
|
||||||
&& !moduleInfo.getProperty(
|
&& !moduleInfo.getProperty(
|
||||||
VERSION)
|
VERSION)
|
||||||
.isEmpty();
|
.isEmpty();
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ public class ModuleManager {
|
||||||
node.getModule().getClass().getName());
|
node.getModule().getClass().getName());
|
||||||
final InstalledModule installedModule = entityManager.find(
|
final InstalledModule installedModule = entityManager.find(
|
||||||
InstalledModule.class, node.
|
InstalledModule.class, node.
|
||||||
getModule().getClass().getName());
|
getModule().getClass().getName().hashCode());
|
||||||
LOGGER.info("Status of module {} ({}): {}",
|
LOGGER.info("Status of module {} ({}): {}",
|
||||||
node.getModuleInfo().getModuleName(),
|
node.getModuleInfo().getModuleName(),
|
||||||
node.getModule().getClass().getName(),
|
node.getModule().getClass().getName(),
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_components", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_COMPONENTS", schema = DB_SCHEMA)
|
||||||
//Can't reduce complexity yet
|
//Can't reduce complexity yet
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
"PMD.StdCyclomaticComplexity",
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
|
@ -53,22 +53,22 @@ public class Component extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1787173100367982069L;
|
private static final long serialVersionUID = 1787173100367982069L;
|
||||||
|
|
||||||
@Column(name = "admin_name")
|
@Column(name = "ADMIN_NAME")
|
||||||
private String adminName;
|
private String adminName;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "formbuilder_component_descriptions",
|
joinTable = @JoinTable(name = "FORMBUILDER_COMPONENT_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "component_id")}))
|
@JoinColumn(name = "COMPONENT_ID")}))
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
@Column(name = "attribute_string")
|
@Column(name = "ATTRIBUTE_STRING")
|
||||||
private String attributeString;
|
private String attributeString;
|
||||||
|
|
||||||
@Column(name = "active")
|
@Column(name = "ACTIVE")
|
||||||
private boolean active;
|
private boolean active;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
|
@ -77,10 +77,10 @@ public class Component extends CcmObject implements Serializable {
|
||||||
@OneToMany(mappedBy = "parentComponent")
|
@OneToMany(mappedBy = "parentComponent")
|
||||||
private List<Component> childComponents;
|
private List<Component> childComponents;
|
||||||
|
|
||||||
@Column(name = "component_order")
|
@Column(name = "COMPONENT_ORDER")
|
||||||
private long componentOrder;
|
private long componentOrder;
|
||||||
|
|
||||||
@Column(name = "selected")
|
@Column(name = "SELECTED")
|
||||||
private boolean selected;
|
private boolean selected;
|
||||||
|
|
||||||
public String getAdminName() {
|
public String getAdminName() {
|
||||||
|
|
|
||||||
|
|
@ -32,15 +32,15 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_data_driven_selects", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_DATA_DRIVEN_SELECTS", schema = DB_SCHEMA)
|
||||||
public class DataDrivenSelect extends Widget implements Serializable {
|
public class DataDrivenSelect extends Widget implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4477753441663454661L;
|
private static final long serialVersionUID = -4477753441663454661L;
|
||||||
|
|
||||||
@Column(name = "multiple")
|
@Column(name = "MULTIPLE")
|
||||||
private boolean multiple;
|
private boolean multiple;
|
||||||
|
|
||||||
@Column(name = "query")
|
@Column(name = "QUERY")
|
||||||
private String query;
|
private String query;
|
||||||
|
|
||||||
public boolean isMultiple() {
|
public boolean isMultiple() {
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,12 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_formsections", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_FORMSECTIONS", schema = DB_SCHEMA)
|
||||||
public class FormSection extends Component implements Serializable {
|
public class FormSection extends Component implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3195157282292906945L;
|
private static final long serialVersionUID = -3195157282292906945L;
|
||||||
|
|
||||||
@Column(name = "formsection_action")
|
@Column(name = "FORMSECTION_ACTION")
|
||||||
private String action;
|
private String action;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "formSection")
|
@OneToMany(mappedBy = "formSection")
|
||||||
|
|
|
||||||
|
|
@ -35,15 +35,15 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_listeners", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_LISTENERS", schema = DB_SCHEMA)
|
||||||
public class Listener extends CcmObject implements Serializable {
|
public class Listener extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 9030104813240364500L;
|
private static final long serialVersionUID = 9030104813240364500L;
|
||||||
|
|
||||||
@Column(name = "class_name")
|
@Column(name = "CLASS_NAME")
|
||||||
private String className;
|
private String className;
|
||||||
|
|
||||||
@Column(name = "attribute_string")
|
@Column(name = "ATTRIBUTE_STRING")
|
||||||
private String attributeString;
|
private String attributeString;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
|
|
||||||
|
|
@ -34,21 +34,21 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_metaobjects", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_METAOBJECTS", schema = DB_SCHEMA)
|
||||||
public class MetaObject extends CcmObject implements Serializable {
|
public class MetaObject extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3770682858640493776L;
|
private static final long serialVersionUID = -3770682858640493776L;
|
||||||
|
|
||||||
@Column(name = "pretty_name")
|
@Column(name = "PRETTY_NAME")
|
||||||
private String prettyName;
|
private String prettyName;
|
||||||
|
|
||||||
@Column(name = "pretty_plural")
|
@Column(name = "PRETTY_PLURAL")
|
||||||
private String prettyPlural;
|
private String prettyPlural;
|
||||||
|
|
||||||
@Column(name = "class_name")
|
@Column(name = "CLASS_NAME")
|
||||||
private String className;
|
private String className;
|
||||||
|
|
||||||
@Column(name = "properties_form")
|
@Column(name = "PROPERTIES_FORM")
|
||||||
private String propertiesForm;
|
private String propertiesForm;
|
||||||
|
|
||||||
public String getPrettyName() {
|
public String getPrettyName() {
|
||||||
|
|
|
||||||
|
|
@ -34,15 +34,15 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_object_types", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_OBJECT_TYPES", schema = DB_SCHEMA)
|
||||||
public class ObjectType extends CcmObject implements Serializable {
|
public class ObjectType extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5236718507025096569L;
|
private static final long serialVersionUID = 5236718507025096569L;
|
||||||
|
|
||||||
@Column(name = "app_name")
|
@Column(name = "APP_NAME")
|
||||||
private String appName;
|
private String appName;
|
||||||
|
|
||||||
@Column(name = "class_name")
|
@Column(name = "CLASS_NAME")
|
||||||
private String className;
|
private String className;
|
||||||
|
|
||||||
public String getAppName() {
|
public String getAppName() {
|
||||||
|
|
|
||||||
|
|
@ -37,20 +37,20 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_options", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_OPTIONS", schema = DB_SCHEMA)
|
||||||
public class Option extends Component implements Serializable {
|
public class Option extends Component implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7528058391772415511L;
|
private static final long serialVersionUID = -7528058391772415511L;
|
||||||
|
|
||||||
@Column(name = "parameter_value")
|
@Column(name = "PARAMETER_VALUE")
|
||||||
private String parameterValue;
|
private String parameterValue;
|
||||||
|
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "formbuilder_option_labels",
|
joinTable = @JoinTable(name = "FORMBUILDER_OPTION_LABELS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "option_id")}))
|
@JoinColumn(name = "OPTION_ID")}))
|
||||||
private LocalizedString label;
|
private LocalizedString label;
|
||||||
|
|
||||||
public String getParameterValue() {
|
public String getParameterValue() {
|
||||||
|
|
|
||||||
|
|
@ -39,30 +39,30 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_data_queries", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_DATA_QUERIES", schema = DB_SCHEMA)
|
||||||
public class PersistentDataQuery extends CcmObject implements Serializable {
|
public class PersistentDataQuery extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7344153915501267752L;
|
private static final long serialVersionUID = -7344153915501267752L;
|
||||||
|
|
||||||
@Column(name = "query_id")
|
@Column(name = "QUERY_ID")
|
||||||
private String queryId;
|
private String queryId;
|
||||||
|
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(
|
joinTable = @JoinTable(
|
||||||
name = "formbuilder_data_query_names",
|
name = "FORMBUILDER_DATA_QUERY_NAMES",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "data_query_id")}))
|
@JoinColumn(name = "DATA_QUERY_ID")}))
|
||||||
private LocalizedString name;
|
private LocalizedString name;
|
||||||
|
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(
|
joinTable = @JoinTable(
|
||||||
name = "formbuilder_data_query_descriptions",
|
name = "FORMBUILDER_DATA_QUERY_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "data_query_id")}))
|
@JoinColumn(name = "DATA_QUERY_ID")}))
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
public String getQueryId() {
|
public String getQueryId() {
|
||||||
|
|
|
||||||
|
|
@ -40,37 +40,37 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_process_listeners", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_PROCESS_LISTENERS", schema = DB_SCHEMA)
|
||||||
public class ProcessListener extends CcmObject implements Serializable {
|
public class ProcessListener extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3029184333026605708L;
|
private static final long serialVersionUID = -3029184333026605708L;
|
||||||
|
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(
|
joinTable = @JoinTable(
|
||||||
name = "formbuilder_process_listener_names",
|
name = "FORMBUILDER_PROCESS_LISTENER_NAMES",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "process_listener_id")}))
|
@JoinColumn(name = "PROCESS_LISTENER_ID")}))
|
||||||
private LocalizedString name;
|
private LocalizedString name;
|
||||||
|
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(
|
joinTable = @JoinTable(
|
||||||
name = "formbuilder_process_listener_descriptions",
|
name = "FORMBUILDER_PROCESS_LISTENER_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "process_listener_id")}))
|
@JoinColumn(name = "PROCESS_LISTENER_ID")}))
|
||||||
|
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
@Column(name = "listener_class")
|
@Column(name = "LISTENER_CLASS")
|
||||||
private String listenerClass;
|
private String listenerClass;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
private FormSection formSection;
|
private FormSection formSection;
|
||||||
|
|
||||||
@Column(name = "process_listener_order")
|
@Column(name = "PROCESS_LISTENER_ORDER")
|
||||||
private long order;
|
private long order;
|
||||||
|
|
||||||
public LocalizedString getName() {
|
public LocalizedString getName() {
|
||||||
|
|
|
||||||
|
|
@ -36,18 +36,18 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_widgets", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_WIDGETS", schema = DB_SCHEMA)
|
||||||
public class Widget extends Component implements Serializable {
|
public class Widget extends Component implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1057792450655098288L;
|
private static final long serialVersionUID = 1057792450655098288L;
|
||||||
|
|
||||||
@Column(name = "parameter_name")
|
@Column(name = "PARAMETER_NAME")
|
||||||
private String parameterName;
|
private String parameterName;
|
||||||
|
|
||||||
@Column(name = "parameter_model")
|
@Column(name = "PARAMETER_MODEL")
|
||||||
private String parameterModel;
|
private String parameterModel;
|
||||||
|
|
||||||
@Column(name = "default_value")
|
@Column(name = "DEFAULT_VALUE")
|
||||||
private String defaultValue;
|
private String defaultValue;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_widget_labels", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_WIDGET_LABELS", schema = DB_SCHEMA)
|
||||||
public class WidgetLabel extends Component implements Serializable {
|
public class WidgetLabel extends Component implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -2939505715812565159L;
|
private static final long serialVersionUID = -2939505715812565159L;
|
||||||
|
|
|
||||||
|
|
@ -22,20 +22,20 @@ import org.libreccm.formbuilder.ProcessListener;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_confirm_email_listener", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_CONFIRM_EMAIL_LISTENER", schema = DB_SCHEMA)
|
||||||
public class ConfirmEmailListener
|
public class ConfirmEmailListener
|
||||||
extends ProcessListener
|
extends ProcessListener
|
||||||
implements Serializable {
|
implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7009695795355273248L;
|
private static final long serialVersionUID = -7009695795355273248L;
|
||||||
|
|
||||||
@Column(name = "from_email")
|
@Column(name = "FROM_EMAIL")
|
||||||
private String fromEmail;
|
private String fromEmail;
|
||||||
|
|
||||||
@Column(name = "subject")
|
@Column(name = "SUBJECT")
|
||||||
private String subject;
|
private String subject;
|
||||||
|
|
||||||
@Column(name = "body")
|
@Column(name = "BODY")
|
||||||
@Lob
|
@Lob
|
||||||
private String body;
|
private String body;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,14 @@ import org.libreccm.formbuilder.ProcessListener;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_confirm_redirect_listeners", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_CONFIRM_REDIRECT_LISTENERS", schema = DB_SCHEMA)
|
||||||
public class ConfirmRedirectListener
|
public class ConfirmRedirectListener
|
||||||
extends ProcessListener
|
extends ProcessListener
|
||||||
implements Serializable {
|
implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7891034630202555922L;
|
private static final long serialVersionUID = 7891034630202555922L;
|
||||||
|
|
||||||
@Column(name = "url")
|
@Column(name = "URL")
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
|
|
|
||||||
|
|
@ -15,18 +15,21 @@ import javax.persistence.Table;
|
||||||
|
|
||||||
import org.libreccm.formbuilder.ProcessListener;
|
import org.libreccm.formbuilder.ProcessListener;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_remote_server_post_listener", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_REMOTE_SERVER_POST_LISTENER", schema = DB_SCHEMA)
|
||||||
public class RemoteServerPostListener
|
public class RemoteServerPostListener
|
||||||
extends ProcessListener
|
extends ProcessListener
|
||||||
implements Serializable {
|
implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7095242410811956838L;
|
private static final long serialVersionUID = 7095242410811956838L;
|
||||||
|
|
||||||
|
@Column(name = "REMOTE_URL", length = 2048)
|
||||||
private String remoteUrl;
|
private String remoteUrl;
|
||||||
|
|
||||||
public String getRemoteUrl() {
|
public String getRemoteUrl() {
|
||||||
|
|
|
||||||
|
|
@ -22,17 +22,17 @@ import java.util.Objects;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_simple_email_listeners", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_SIMPLE_EMAIL_LISTENERS", schema = DB_SCHEMA)
|
||||||
public class SimpleEmailListener
|
public class SimpleEmailListener
|
||||||
extends ProcessListener
|
extends ProcessListener
|
||||||
implements Serializable {
|
implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5004346250775992079L;
|
private static final long serialVersionUID = -5004346250775992079L;
|
||||||
|
|
||||||
@Column(name = "recipient")
|
@Column(name = "RECIPIENT")
|
||||||
private String recipient;
|
private String recipient;
|
||||||
|
|
||||||
@Column(name = "subject")
|
@Column(name = "SUBJECT")
|
||||||
private String subject;
|
private String subject;
|
||||||
|
|
||||||
public String getRecipient() {
|
public String getRecipient() {
|
||||||
|
|
|
||||||
|
|
@ -22,20 +22,20 @@ import org.libreccm.formbuilder.ProcessListener;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_template_email_listeners", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_TEMPLATE_EMAIL_LISTENERS", schema = DB_SCHEMA)
|
||||||
public class TemplateEmailListener
|
public class TemplateEmailListener
|
||||||
extends ProcessListener
|
extends ProcessListener
|
||||||
implements Serializable {
|
implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4476860960485494976L;
|
private static final long serialVersionUID = -4476860960485494976L;
|
||||||
|
|
||||||
@Column(name = "recipient")
|
@Column(name = "RECIPIENT")
|
||||||
private String recipient;
|
private String recipient;
|
||||||
|
|
||||||
@Column(name = "subject")
|
@Column(name = "SUBJECT")
|
||||||
private String subject;
|
private String subject;
|
||||||
|
|
||||||
@Column(name = "body")
|
@Column(name = "BODY")
|
||||||
@Lob
|
@Lob
|
||||||
private String body;
|
private String body;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,15 @@ import org.libreccm.formbuilder.ProcessListener;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "formbuilder_xml_email_listeners", schema = DB_SCHEMA)
|
@Table(name = "FORMBUILDER_XML_EMAIL_LISTENERS", schema = DB_SCHEMA)
|
||||||
public class XmlEmailListener extends ProcessListener implements Serializable {
|
public class XmlEmailListener extends ProcessListener implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4607965414018004925L;
|
private static final long serialVersionUID = -4607965414018004925L;
|
||||||
|
|
||||||
@Column(name = "recipient")
|
@Column(name = "RECIPIENT")
|
||||||
private String recipient;
|
private String recipient;
|
||||||
|
|
||||||
@Column(name = "subject")
|
@Column(name = "SUBJECT")
|
||||||
private String subject;
|
private String subject;
|
||||||
|
|
||||||
public String getRecipient() {
|
public String getRecipient() {
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,8 @@ public class LocalizedString implements Serializable {
|
||||||
* The localised values of the string.
|
* The localised values of the string.
|
||||||
*/
|
*/
|
||||||
@ElementCollection
|
@ElementCollection
|
||||||
@MapKeyColumn(name = "locale")
|
@MapKeyColumn(name = "LOCALE")
|
||||||
@Column(name = "localized_value")
|
@Column(name = "LOCALIZED_VALUE")
|
||||||
@Lob
|
@Lob
|
||||||
@XmlElementWrapper(name = "values", namespace = L10N_XML_NS)
|
@XmlElementWrapper(name = "values", namespace = L10N_XML_NS)
|
||||||
@XmlElement(name = "value", namespace = L10N_XML_NS)
|
@XmlElement(name = "value", namespace = L10N_XML_NS)
|
||||||
|
|
|
||||||
|
|
@ -43,31 +43,31 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "attachments", schema = DB_SCHEMA)
|
@Table(name = "ATTACHMENTS", schema = DB_SCHEMA)
|
||||||
public class Attachment implements Serializable {
|
public class Attachment implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2063934721452863106L;
|
private static final long serialVersionUID = 2063934721452863106L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "attachment_id")
|
@Column(name = "ATTACHMENT_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long attachmentId;
|
private long attachmentId;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "message_id")
|
@JoinColumn(name = "MESSAGE_ID")
|
||||||
private Message message;
|
private Message message;
|
||||||
|
|
||||||
@Column(name = "mime_type")
|
@Column(name = "MIME_TYPE")
|
||||||
@Convert(converter = MimeTypeConverter.class)
|
@Convert(converter = MimeTypeConverter.class)
|
||||||
private MimeType mimeType;
|
private MimeType mimeType;
|
||||||
|
|
||||||
@Column(name = "title")
|
@Column(name = "TITLE")
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
@Column(name = "description")
|
@Column(name = "DESCRIPTION")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@Column(name = "attachment_data")
|
@Column(name = "ATTACHMENT_DATA")
|
||||||
@Lob
|
@Lob
|
||||||
private byte[] data;
|
private byte[] data;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ import javax.persistence.TemporalType;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "messages", schema = DB_SCHEMA)
|
@Table(name = "MESSAGES", schema = DB_SCHEMA)
|
||||||
//Can't reduce complexity yet
|
//Can't reduce complexity yet
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
"PMD.StdCyclomaticComplexity",
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
|
@ -58,25 +58,25 @@ public class Message extends CcmObject implements Serializable {
|
||||||
private static final long serialVersionUID = -9143137794418932025L;
|
private static final long serialVersionUID = -9143137794418932025L;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "sender_id")
|
@JoinColumn(name = "SENDER_ID")
|
||||||
private Subject sender;
|
private Subject sender;
|
||||||
|
|
||||||
@Column(name = "subject")
|
@Column(name = "SUBJECT")
|
||||||
private String subject;
|
private String subject;
|
||||||
|
|
||||||
@Column(name = "body")
|
@Column(name = "BODY")
|
||||||
private String body;
|
private String body;
|
||||||
|
|
||||||
@Column(name = "body_mime_type")
|
@Column(name = "BODY_MIME_TYPE")
|
||||||
@Convert(converter = MimeTypeConverter.class)
|
@Convert(converter = MimeTypeConverter.class)
|
||||||
private MimeType bodyMimeType;
|
private MimeType bodyMimeType;
|
||||||
|
|
||||||
@Column(name = "sent")
|
@Column(name = "SENT")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date sent;
|
private Date sent;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "in_reply_to_id")
|
@JoinColumn(name = "IN_REPLY_TO_ID")
|
||||||
private Message inReplyTo;
|
private Message inReplyTo;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "inReplyTo")
|
@OneToMany(mappedBy = "inReplyTo")
|
||||||
|
|
|
||||||
|
|
@ -35,13 +35,13 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "threads", schema = DB_SCHEMA)
|
@Table(name = "THREADS", schema = DB_SCHEMA)
|
||||||
public class MessageThread extends CcmObject implements Serializable {
|
public class MessageThread extends CcmObject implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -395123286904985770L;
|
private static final long serialVersionUID = -395123286904985770L;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "root_id")
|
@JoinColumn(name = "ROOT_ID")
|
||||||
private Message root;
|
private Message root;
|
||||||
|
|
||||||
public Message getRoot() {
|
public Message getRoot() {
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ import javax.persistence.TemporalType;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "digests", schema = DB_SCHEMA)
|
@Table(name = "DIGESTS", schema = DB_SCHEMA)
|
||||||
//Can't reduce complexity yet
|
//Can't reduce complexity yet
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
"PMD.StdCyclomaticComplexity",
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
|
@ -59,25 +59,25 @@ public class Digest extends CcmObject implements Serializable {
|
||||||
private static final long serialVersionUID = -3526066971290670390L;
|
private static final long serialVersionUID = -3526066971290670390L;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "from_party_id")
|
@JoinColumn(name = "FROM_PARTY_ID")
|
||||||
private Subject fromParty;
|
private Subject fromParty;
|
||||||
|
|
||||||
@Column(name = "subject", length = 255, nullable = false)
|
@Column(name = "SUBJECT", length = 255, nullable = false)
|
||||||
private String subject;
|
private String subject;
|
||||||
|
|
||||||
@Column(name = "header", length = 4096, nullable = false)
|
@Column(name = "HEADER", length = 4096, nullable = false)
|
||||||
private String header;
|
private String header;
|
||||||
|
|
||||||
@Column(name = "digest_separator", length = 128, nullable = false)
|
@Column(name = "DIGEST_SEPARATOR", length = 128, nullable = false)
|
||||||
private String separator;
|
private String separator;
|
||||||
|
|
||||||
@Column(name = "signature", length = 4096, nullable = false)
|
@Column(name = "SIGNATURE", length = 4096, nullable = false)
|
||||||
private String signature;
|
private String signature;
|
||||||
|
|
||||||
@Column(name = "frequency")
|
@Column(name = "FREQUENCY")
|
||||||
private Integer frequency;
|
private Integer frequency;
|
||||||
|
|
||||||
@Column(name = "next_run")
|
@Column(name = "NEXT_RUN")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date nextRun;
|
private Date nextRun;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ import javax.persistence.TemporalType;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "notifications", schema = DB_SCHEMA)
|
@Table(name = "NOTIFICATIONS", schema = DB_SCHEMA)
|
||||||
//Can't reduce complexity yet. Not sure what to do about the God class warning.
|
//Can't reduce complexity yet. Not sure what to do about the God class warning.
|
||||||
//Maybe we have to put some of the properties into an extra class.
|
//Maybe we have to put some of the properties into an extra class.
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
|
@ -82,44 +82,44 @@ public class Notification extends CcmObject implements Serializable {
|
||||||
private static final long serialVersionUID = -6052859580690813506L;
|
private static final long serialVersionUID = -6052859580690813506L;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "receiver_id")
|
@JoinColumn(name = "RECEIVER_ID")
|
||||||
private Subject receiver;
|
private Subject receiver;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "digest_id")
|
@JoinColumn(name = "DIGEST_ID")
|
||||||
private Digest digest;
|
private Digest digest;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "message_id")
|
@JoinColumn(name = "MESSAGE_ID")
|
||||||
private Message message;
|
private Message message;
|
||||||
|
|
||||||
@Column(name = "header", length = 4096)
|
@Column(name = "HEADER", length = 4096)
|
||||||
private String header;
|
private String header;
|
||||||
|
|
||||||
@Column(name = "signature", length = 4096)
|
@Column(name = "SIGNATURE", length = 4096)
|
||||||
private String signature;
|
private String signature;
|
||||||
|
|
||||||
@Column(name = "expand_group")
|
@Column(name = "EXPAND_GROUP")
|
||||||
private boolean expandGroup;
|
private boolean expandGroup;
|
||||||
|
|
||||||
@Column(name = "request_date")
|
@Column(name = "REQUEST_DATE")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date requestDate;
|
private Date requestDate;
|
||||||
|
|
||||||
@Column(name = "fulfill_date")
|
@Column(name = "FULFILL_DATE")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date fulfillDate;
|
private Date fulfillDate;
|
||||||
|
|
||||||
@Column(name = "status", length = 32)
|
@Column(name = "STATUS", length = 32)
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@Column(name = "max_retries")
|
@Column(name = "MAX_RETRIES")
|
||||||
private long maxRetries;
|
private long maxRetries;
|
||||||
|
|
||||||
@Column(name = "expunge")
|
@Column(name = "EXPUNGE")
|
||||||
private boolean expunge;
|
private boolean expunge;
|
||||||
|
|
||||||
@Column(name = "expunge_message")
|
@Column(name = "EXPUNGE_MESSAGE")
|
||||||
private boolean expungeMessage;
|
private boolean expungeMessage;
|
||||||
|
|
||||||
public Subject getReceiver() {
|
public Subject getReceiver() {
|
||||||
|
|
@ -308,10 +308,7 @@ public class Notification extends CcmObject implements Serializable {
|
||||||
if (expunge != other.isExpunge()) {
|
if (expunge != other.isExpunge()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (expungeMessage != other.isExpungeMessage()) {
|
return expungeMessage == other.isExpungeMessage();
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "queue_items", schema = DB_SCHEMA)
|
@Table(name = "QUEUE_ITEMS", schema = DB_SCHEMA)
|
||||||
//Can't reduce complexity yet
|
//Can't reduce complexity yet
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
"PMD.StdCyclomaticComplexity",
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
|
@ -56,31 +56,31 @@ public class QueueItem implements Serializable {
|
||||||
private static final long serialVersionUID = 396330385592074013L;
|
private static final long serialVersionUID = 396330385592074013L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "queue_item_id")
|
@Column(name = "QUEUE_ITEM_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long queueItemId;
|
private long queueItemId;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "receiver_id")
|
@JoinColumn(name = "RECEIVER_ID")
|
||||||
private Subject receiver;
|
private Subject receiver;
|
||||||
|
|
||||||
@Column(name = "retry_count")
|
@Column(name = "RETRY_COUNT")
|
||||||
private long retryCount;
|
private long retryCount;
|
||||||
|
|
||||||
@Column(name = "successful_sended")
|
@Column(name = "SUCCESSFUL_SENDED")
|
||||||
private boolean successful;
|
private boolean successful;
|
||||||
|
|
||||||
@Column(name = "receiver_address", length = 512)
|
@Column(name = "RECEIVER_ADDRESS", length = 512)
|
||||||
private String receiverAddress;
|
private String receiverAddress;
|
||||||
|
|
||||||
@Column(name = "header", length = 4096)
|
@Column(name = "HEADER", length = 4096)
|
||||||
private String header;
|
private String header;
|
||||||
|
|
||||||
@Column(name = "signature", length = 4096)
|
@Column(name = "SIGNATURE", length = 4096)
|
||||||
private String signature;
|
private String signature;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "message_id")
|
@JoinColumn(name = "MESSAGE_ID")
|
||||||
private Message message;
|
private Message message;
|
||||||
|
|
||||||
public long getQueueItemId() {
|
public long getQueueItemId() {
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,12 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "portals", schema = DB_SCHEMA)
|
@Table(name = "PORTALS", schema = DB_SCHEMA)
|
||||||
public class Portal extends Resource implements Serializable {
|
public class Portal extends Resource implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5492307663469206053L;
|
private static final long serialVersionUID = -5492307663469206053L;
|
||||||
|
|
||||||
@Column(name = "template")
|
@Column(name = "TEMPLATE")
|
||||||
private boolean template;
|
private boolean template;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "portal")
|
@OneToMany(mappedBy = "portal")
|
||||||
|
|
|
||||||
|
|
@ -37,19 +37,19 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "portlets", schema = DB_SCHEMA)
|
@Table(name = "PORTLETS", schema = DB_SCHEMA)
|
||||||
public class Portlet extends Resource implements Serializable {
|
public class Portlet extends Resource implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5718126018588744104L;
|
private static final long serialVersionUID = -5718126018588744104L;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "portal_id")
|
@JoinColumn(name = "PORTAL_ID")
|
||||||
private Portal portal;
|
private Portal portal;
|
||||||
|
|
||||||
@Column(name = "cell_number")
|
@Column(name = "CELL_NUMBER")
|
||||||
private long cellNumber;
|
private long cellNumber;
|
||||||
|
|
||||||
@Column(name = "sort_key")
|
@Column(name = "SORT_KEY")
|
||||||
private long sortKey;
|
private long sortKey;
|
||||||
|
|
||||||
public Portal getPortal() {
|
public Portal getPortal() {
|
||||||
|
|
|
||||||
|
|
@ -41,21 +41,21 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "inits", schema = DB_SCHEMA)
|
@Table(name = "INITS", schema = DB_SCHEMA)
|
||||||
public class Initalizer implements Serializable {
|
public class Initalizer implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 9150623897315380159L;
|
private static final long serialVersionUID = 9150623897315380159L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "initializer_id")
|
@Column(name = "INITIALIZER_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long initializerId;
|
private long initializerId;
|
||||||
|
|
||||||
@Column(name = "class_name")
|
@Column(name = "CLASS_NAME")
|
||||||
private String className;
|
private String className;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "required_by_id")
|
@JoinColumn(name = "REQUIRED_BY_ID")
|
||||||
private Initalizer requiredBy;
|
private Initalizer requiredBy;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "requiredBy")
|
@OneToMany(mappedBy = "requiredBy")
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ import javax.persistence.TemporalType;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "lucene_documents", schema = DB_SCHEMA)
|
@Table(name = "LUCENE_DOCUMENTS", schema = DB_SCHEMA)
|
||||||
//Can't reduce complexity yet. Not sure what to do about the God class warning.
|
//Can't reduce complexity yet. Not sure what to do about the God class warning.
|
||||||
//Maybe we have to put some of the properties into an extra class.
|
//Maybe we have to put some of the properties into an extra class.
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
|
@ -55,56 +55,56 @@ public class Document implements Serializable {
|
||||||
private static final long serialVersionUID = 3363154040440909619L;
|
private static final long serialVersionUID = 3363154040440909619L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "document_id")
|
@Column(name = "DOCUMENT_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long documentId;
|
private long documentId;
|
||||||
|
|
||||||
@Column(name = "type")
|
@Column(name = "TYPE")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@Column(name = "type_specific_info", length = 512)
|
@Column(name = "TYPE_SPECIFIC_INFO", length = 512)
|
||||||
private String typeSpecificInfo;
|
private String typeSpecificInfo;
|
||||||
|
|
||||||
@Column(name = "document_timestamp")
|
@Column(name = "DOCUMENT_TIMESTAMP")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date timeStamp;
|
private Date timeStamp;
|
||||||
|
|
||||||
@Column(name = "dirty")
|
@Column(name = "DIRTY")
|
||||||
private long dirty;
|
private long dirty;
|
||||||
|
|
||||||
@Column(name = "document_language", length = 8)
|
@Column(name = "DOCUMENT_LANGUAGE", length = 8)
|
||||||
private String language;
|
private String language;
|
||||||
|
|
||||||
@Column(name = "country", length = 8)
|
@Column(name = "COUNTRY", length = 8)
|
||||||
private String country;
|
private String country;
|
||||||
|
|
||||||
@Column(name = "title", length = 4096)
|
@Column(name = "TITLE", length = 4096)
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
@Column(name = "summary", length = 4096)
|
@Column(name = "SUMMARY", length = 4096)
|
||||||
private String summary;
|
private String summary;
|
||||||
|
|
||||||
@Column(name = "content")
|
@Column(name = "CONTENT")
|
||||||
@Lob
|
@Lob
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
@Column(name = "created")
|
@Column(name = "CREATED")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date created;
|
private Date created;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "created_by_party_id")
|
@JoinColumn(name = "CREATED_BY_PARTY_ID")
|
||||||
private Subject createdBy;
|
private Subject createdBy;
|
||||||
|
|
||||||
@Column(name = "last_modified")
|
@Column(name = "LAST_MODIFIED")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date lastModified;
|
private Date lastModified;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "last_modified_by")
|
@JoinColumn(name = "LAST_MODIFIED_BY")
|
||||||
private Subject lastModifiedBy;
|
private Subject lastModifiedBy;
|
||||||
|
|
||||||
@Column(name = "content_section", length = 512)
|
@Column(name = "CONTENT_SECTION", length = 512)
|
||||||
private String contentSection;
|
private String contentSection;
|
||||||
|
|
||||||
public Document() {
|
public Document() {
|
||||||
|
|
|
||||||
|
|
@ -39,21 +39,21 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "lucene_indexes", schema = DB_SCHEMA)
|
@Table(name = "LUCENE_INDEXES", schema = DB_SCHEMA)
|
||||||
public class Index implements Serializable {
|
public class Index implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 3197625173477366719L;
|
private static final long serialVersionUID = 3197625173477366719L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "index_id")
|
@Column(name = "INDEX_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long indexId;
|
private long indexId;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "host_id")
|
@JoinColumn(name = "HOST_ID")
|
||||||
private Host host;
|
private Host host;
|
||||||
|
|
||||||
@Column(name = "lucene_index_id")
|
@Column(name = "LUCENE_INDEX_ID")
|
||||||
private long luceneIndexId;
|
private long luceneIndexId;
|
||||||
|
|
||||||
public Index() {
|
public Index() {
|
||||||
|
|
|
||||||
|
|
@ -53,19 +53,19 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "applications", schema = DB_SCHEMA)
|
@Table(name = "APPLICATIONS", schema = DB_SCHEMA)
|
||||||
@XmlRootElement(name = "application", namespace = WEB_XML_NS)
|
@XmlRootElement(name = "application", namespace = WEB_XML_NS)
|
||||||
public class Application extends Resource implements Serializable {
|
public class Application extends Resource implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 9205226362368890784L;
|
private static final long serialVersionUID = 9205226362368890784L;
|
||||||
|
|
||||||
@Column(name = "primary_url", length = 1024, nullable = false)
|
@Column(name = "PRIMARY_URL", length = 1024, nullable = false)
|
||||||
@Convert(converter = UriConverter.class)
|
@Convert(converter = UriConverter.class)
|
||||||
@XmlElement(name = "primary-url", namespace = WEB_XML_NS)
|
@XmlElement(name = "primary-url", namespace = WEB_XML_NS)
|
||||||
private URI primaryUrl;
|
private URI primaryUrl;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "container_group_id")
|
@JoinColumn(name = "CONTAINER_GROUP_ID")
|
||||||
@XmlElement(name = "container-group", namespace = WEB_XML_NS)
|
@XmlElement(name = "container-group", namespace = WEB_XML_NS)
|
||||||
private Group containerGroup;
|
private Group containerGroup;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ import org.libreccm.core.ResourceType;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "application_types", schema = DB_SCHEMA)
|
@Table(name = "APPLICATION_TYPES", schema = DB_SCHEMA)
|
||||||
@SuppressWarnings("PMD.LongVariable")
|
@SuppressWarnings("PMD.LongVariable")
|
||||||
public class ApplicationType extends ResourceType implements Serializable {
|
public class ApplicationType extends ResourceType implements Serializable {
|
||||||
|
|
||||||
|
|
@ -49,16 +49,16 @@ public class ApplicationType extends ResourceType implements Serializable {
|
||||||
private static final String PMD_LONG_VARIABLE = "PMD.LongVariable";
|
private static final String PMD_LONG_VARIABLE = "PMD.LongVariable";
|
||||||
|
|
||||||
@OneToMany
|
@OneToMany
|
||||||
@JoinColumn(name = "relevant_privilege_id")
|
@JoinColumn(name = "RELEVANT_PRIVILEGE_ID")
|
||||||
@SuppressWarnings(PMD_LONG_VARIABLE)
|
@SuppressWarnings(PMD_LONG_VARIABLE)
|
||||||
private List<Privilege> relevantPrivileges;
|
private List<Privilege> relevantPrivileges;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "container_group_id")
|
@JoinColumn(name = "CONTAINER_GROUP_ID")
|
||||||
private Group containerGroup;
|
private Group containerGroup;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "provider_app_type_id")
|
@JoinColumn(name = "PROVIDER_APP_TYPE_ID")
|
||||||
@SuppressWarnings(PMD_LONG_VARIABLE)
|
@SuppressWarnings(PMD_LONG_VARIABLE)
|
||||||
private ApplicationType providerApplicationType;
|
private ApplicationType providerApplicationType;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,23 +36,23 @@ import javax.persistence.UniqueConstraint;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "hosts", schema = DB_SCHEMA,
|
@Table(name = "HOSTS", schema = DB_SCHEMA,
|
||||||
uniqueConstraints = {
|
uniqueConstraints = {
|
||||||
@UniqueConstraint(columnNames = {"server_name", "server_port"})})
|
@UniqueConstraint(columnNames = {"SERVER_NAME", "SERVER_PORT"})})
|
||||||
@SuppressWarnings("PMD.ShortClassName") //Host is perfectly fine as class name...
|
@SuppressWarnings("PMD.ShortClassName") //Host is perfectly fine as class name...
|
||||||
public class Host implements Serializable {
|
public class Host implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 8727376444061847375L;
|
private static final long serialVersionUID = 8727376444061847375L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "host_id")
|
@Column(name = "HOST_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long hostId;
|
private long hostId;
|
||||||
|
|
||||||
@Column(name = "server_name", length = 512)
|
@Column(name = "SERVER_NAME", length = 512)
|
||||||
private String serverName;
|
private String serverName;
|
||||||
|
|
||||||
@Column(name = "server_port")
|
@Column(name = "SERVER_PORT")
|
||||||
private long serverPort;
|
private long serverPort;
|
||||||
|
|
||||||
public long getHostId() {
|
public long getHostId() {
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "workflow_tasks", schema = DB_SCHEMA)
|
@Table(name = "WORKFLOW_TASKS", schema = DB_SCHEMA)
|
||||||
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
|
||||||
//Can't reduce complexity yet, Task is a fine name
|
//Can't reduce complexity yet, Task is a fine name
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
|
|
@ -64,56 +64,56 @@ public class Task implements Serializable {
|
||||||
private static final long serialVersionUID = 8161343036908150426L;
|
private static final long serialVersionUID = 8161343036908150426L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "task_id")
|
@Column(name = "TASK_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long taskId;
|
private long taskId;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "workflow_task_labels",
|
joinTable = @JoinTable(name = "WORKFLOW_TASK_LABELS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "task_id")}))
|
@JoinColumn(name = "TASK_ID")}))
|
||||||
private LocalizedString label;
|
private LocalizedString label;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "workflow_tasks_descriptions",
|
joinTable = @JoinTable(name = "WORKFLOW_TASKS_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "task_id")}))
|
@JoinColumn(name = "TASK_ID")}))
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
@Column(name = "active")
|
@Column(name = "ACTIVE")
|
||||||
private boolean active;
|
private boolean active;
|
||||||
|
|
||||||
@Column(name = "task_state", length = 512)
|
@Column(name = "TASK_STATE", length = 512)
|
||||||
private String taskState;
|
private String taskState;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "workflow_id")
|
@JoinColumn(name = "WORKFLOW_ID")
|
||||||
private Workflow workflow;
|
private Workflow workflow;
|
||||||
|
|
||||||
@ManyToMany(mappedBy = "dependsOn")
|
@ManyToMany(mappedBy = "dependsOn")
|
||||||
private List<Task> dependentTasks;
|
private List<Task> dependentTasks;
|
||||||
|
|
||||||
@ManyToMany
|
@ManyToMany
|
||||||
@JoinTable(name = "workflow_task_dependencies",
|
@JoinTable(name = "WORKFLOW_TASK_DEPENDENCIES",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "depends_on_task_id")},
|
@JoinColumn(name = "DEPENDS_ON_TASK_ID")},
|
||||||
inverseJoinColumns = {
|
inverseJoinColumns = {
|
||||||
@JoinColumn(name = "dependent_task_id")})
|
@JoinColumn(name = "DEPENDENT_TASK_ID")})
|
||||||
private List<Task> dependsOn;
|
private List<Task> dependsOn;
|
||||||
|
|
||||||
@ElementCollection
|
@ElementCollection
|
||||||
@JoinTable(name = "workflow_task_comments",
|
@JoinTable(name = "WORKFLOW_TASK_COMMENTS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "task_id")})
|
@JoinColumn(name = "TASK_ID")})
|
||||||
@Column(name = "comment")
|
@Column(name = "COMMENT")
|
||||||
@Lob
|
@Lob
|
||||||
private List<String> comments;
|
private List<String> comments;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ import javax.persistence.TemporalType;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "workflow_user_tasks", schema = DB_SCHEMA)
|
@Table(name = "WORKFLOW_USER_TASKS", schema = DB_SCHEMA)
|
||||||
//Can't reduce complexity yet
|
//Can't reduce complexity yet
|
||||||
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
@SuppressWarnings({"PMD.CyclomaticComplexity",
|
||||||
"PMD.StdCyclomaticComplexity",
|
"PMD.StdCyclomaticComplexity",
|
||||||
|
|
@ -54,45 +54,45 @@ public class UserTask extends Task implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4188064584389893019L;
|
private static final long serialVersionUID = 4188064584389893019L;
|
||||||
|
|
||||||
@Column(name = "locked")
|
@Column(name = "LOCKED")
|
||||||
private boolean locked;
|
private boolean locked;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "locking_user_id")
|
@JoinColumn(name = "LOCKING_USER_ID")
|
||||||
private User lockingUser;
|
private User lockingUser;
|
||||||
|
|
||||||
@Column(name = "start_date")
|
@Column(name = "START_DATE")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date startDate;
|
private Date startDate;
|
||||||
|
|
||||||
@Column(name = "due_date")
|
@Column(name = "DUE_DATE")
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date dueDate;
|
private Date dueDate;
|
||||||
|
|
||||||
@Column(name = "duration_minutes")
|
@Column(name = "DURATION_MINUTES")
|
||||||
private long durationMinutes;
|
private long durationMinutes;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "notification_sender")
|
@JoinColumn(name = "NOTIFICATION_SENDER")
|
||||||
@SuppressWarnings("PMD.LongVariable") //Shorter name would not be descriptive
|
@SuppressWarnings("PMD.LongVariable") //Shorter name would not be descriptive
|
||||||
private User notificationSender;
|
private User notificationSender;
|
||||||
|
|
||||||
@OneToMany
|
@OneToMany
|
||||||
@JoinTable(name = "workflow_user_task_assigned_users",
|
@JoinTable(name = "WORKFLOW_USER_TASK_ASSIGNED_USERS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "user_task_id")},
|
@JoinColumn(name = "USER_TASK_ID")},
|
||||||
inverseJoinColumns = {
|
inverseJoinColumns = {
|
||||||
@JoinColumn(name = "assigned_user_id")})
|
@JoinColumn(name = "ASSIGNED_USER_ID")})
|
||||||
private List<User> assignedUsers;
|
private List<User> assignedUsers;
|
||||||
|
|
||||||
@OneToMany
|
@OneToMany
|
||||||
@JoinTable(name = "workflow_user_task_assigned_groups",
|
@JoinTable(name = "WORKFLOW_USER_TASK_ASSIGNED_GROUPS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "user_task_id")},
|
@JoinColumn(name = "USER_TASK_ID")},
|
||||||
inverseJoinColumns = {
|
inverseJoinColumns = {
|
||||||
@JoinColumn(name = "assigned_group_id")})
|
@JoinColumn(name = "ASSIGNED_GROUP_ID")})
|
||||||
private List<Group> assignedGroups;
|
private List<Group> assignedGroups;
|
||||||
|
|
||||||
public UserTask() {
|
public UserTask() {
|
||||||
|
|
|
||||||
|
|
@ -45,32 +45,32 @@ import javax.persistence.Table;
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "workflows", schema = DB_SCHEMA)
|
@Table(name = "WORKFLOWS", schema = DB_SCHEMA)
|
||||||
public class Workflow implements Serializable {
|
public class Workflow implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4322500264543325829L;
|
private static final long serialVersionUID = 4322500264543325829L;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "workflow_id")
|
@Column(name = "WORKFLOW_ID")
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
private long workflowId;
|
private long workflowId;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "workflow_names",
|
joinTable = @JoinTable(name = "WORKFLOW_NAMES",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "workflow_id")}))
|
@JoinColumn(name = "WORKFLOW_ID")}))
|
||||||
private LocalizedString name;
|
private LocalizedString name;
|
||||||
|
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "VALUES",
|
||||||
joinTable = @JoinTable(name = "workflow_descriptions",
|
joinTable = @JoinTable(name = "WORKFLOW_DESCRIPTIONS",
|
||||||
schema = DB_SCHEMA,
|
schema = DB_SCHEMA,
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@JoinColumn(name = "workflow_id")
|
@JoinColumn(name = "WORKFLOW_ID")
|
||||||
}))
|
}))
|
||||||
private LocalizedString description;
|
private LocalizedString description;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
create sequence hibernate_sequence start with 1 increment by 1;
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +0,0 @@
|
||||||
-- Used by the org.libreccm.core.modules.CcmModulesTest to clean up the
|
|
||||||
-- schema before the test
|
|
||||||
|
|
||||||
DROP SCHEMA IF EXISTS ccm_core;
|
|
||||||
|
|
||||||
DROP SEQUENCE IF EXISTS hibernate_sequence;
|
|
||||||
|
|
@ -62,6 +62,16 @@
|
||||||
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
|
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.shrinkwrap.resolver</groupId>
|
||||||
|
<artifactId>shrinkwrap-resolver-spi</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jboss.shrinkwrap.resolver</groupId>
|
||||||
|
<artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
@ -351,7 +361,7 @@
|
||||||
</testResources>
|
</testResources>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<!--<plugin>
|
||||||
<groupId>de.jpdigital</groupId>
|
<groupId>de.jpdigital</groupId>
|
||||||
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
<artifactId>hibernate4-ddl-maven-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|
@ -373,7 +383,7 @@
|
||||||
<phase>process-classes</phase>
|
<phase>process-classes</phase>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>-->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
author: Jens Pelzetter
|
|
||||||
-->
|
|
||||||
|
|
||||||
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
|
|
||||||
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
|
|
||||||
version="2.1">
|
|
||||||
|
|
||||||
<persistence-unit name="LibreCCM" transaction-type="JTA">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Enforce JPA provider
|
|
||||||
Not really necessary here because we don't use any Hibernate
|
|
||||||
specific features, but makes it easier to manage to database
|
|
||||||
creation scripts.
|
|
||||||
-->
|
|
||||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
||||||
|
|
||||||
<jta-data-source>java:/comp/env/jdbc/ccm-core/db</jta-data-source>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<!-- Properties for Hibernate -->
|
|
||||||
<property name="hibernate.hbm2ddl.auto" value="verify"/>
|
|
||||||
<property name="hibernate.connection.autocommit" value="false" />
|
|
||||||
<property name="hibernate.id.new_generator_mappings" value="true"/>
|
|
||||||
<property name="hibernate.id.new_generator_mappings" value="true"/>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Properties for Hibernate Envers
|
|
||||||
We are using the ValidityAuditStrategy here because it is faster
|
|
||||||
when querying data than the DefaultStrategy
|
|
||||||
-->
|
|
||||||
<property name="org.hibernate.envers.audit_strategy"
|
|
||||||
value="org.hibernate.envers.strategy.ValidityAuditStrategy"/>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
</persistence-unit>
|
|
||||||
|
|
||||||
</persistence>
|
|
||||||
|
|
@ -40,9 +40,13 @@ import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
||||||
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
||||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||||
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
||||||
|
import org.jboss.shrinkwrap.api.spec.JavaArchive;
|
||||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
||||||
|
import org.jboss.shrinkwrap.resolver.api.maven.MavenResolvedArtifact;
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
||||||
|
import org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenCoordinates;
|
||||||
|
import org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenDependencyExclusion;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
|
|
||||||
|
|
@ -101,30 +105,53 @@ public class CcmModulesTest {
|
||||||
.loadPomFromFile("pom.xml");
|
.loadPomFromFile("pom.xml");
|
||||||
final PomEquippedResolveStage dependencies = pom
|
final PomEquippedResolveStage dependencies = pom
|
||||||
.importCompileAndRuntimeDependencies();
|
.importCompileAndRuntimeDependencies();
|
||||||
final File[] libs = dependencies.resolve().withTransitivity().asFile();
|
//final File[] libs = dependencies.resolve().withTransitivity().asFile();
|
||||||
|
final MavenResolvedArtifact[] artifacts = dependencies.resolve()
|
||||||
|
.withTransitivity().asResolvedArtifact();
|
||||||
|
|
||||||
for (File lib : libs) {
|
// for (File lib : libs) {
|
||||||
System.err.printf("Adding file '%s' to test archive...%n",
|
// System.err.printf("Adding file '%s' to test archive...%n",
|
||||||
lib.getName());
|
// lib.getName());
|
||||||
|
// }
|
||||||
|
final WebArchive webArchive = ShrinkWrap.create(
|
||||||
|
WebArchive.class, "LibreCCM-org.libreccm.CcmModulesTest.war");
|
||||||
|
for (final MavenResolvedArtifact artifact : artifacts) {
|
||||||
|
final JavaArchive archive = artifact.as(JavaArchive.class);
|
||||||
|
|
||||||
|
if (archive.getName().startsWith("ccm-core")) {
|
||||||
|
archive.delete("META-INF/persistence.xml");
|
||||||
|
}
|
||||||
|
|
||||||
|
System.err.printf("Adding archive '%s' to test archive...%n",
|
||||||
|
archive.getName());
|
||||||
|
|
||||||
|
webArchive.addAsLibrary(archive);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ShrinkWrap
|
webArchive.addPackage(IntegrationTest.class.getPackage())
|
||||||
.create(WebArchive.class,
|
|
||||||
"LibreCCM-org.libreccm.CcmModulesTest.war")
|
|
||||||
.addAsLibraries(libs)
|
|
||||||
.addPackage(IntegrationTest.class.getPackage())
|
|
||||||
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
|
.setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
|
||||||
.addAsResource("test-persistence.xml", "META-INF/persistence.xml")
|
.addAsResource("test-persistence.xml", "META-INF/persistence.xml")
|
||||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
|
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
|
||||||
|
|
||||||
|
return webArchive;
|
||||||
|
|
||||||
|
// return ShrinkWrap
|
||||||
|
// .create(WebArchive.class,
|
||||||
|
// "LibreCCM-org.libreccm.CcmModulesTest.war")
|
||||||
|
// .addAsLibraries(libs)
|
||||||
|
// .addPackage(IntegrationTest.class.getPackage())
|
||||||
|
// .setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
|
||||||
|
// .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
|
||||||
|
// .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@CleanupUsingScript("clean_schema.sql")
|
@CleanupUsingScript("clean_schema.sql")
|
||||||
public void verifyModules() throws SQLException {
|
public void verifyModules() throws SQLException {
|
||||||
|
|
||||||
//Extract JDBC connnection from EntityManager
|
//Extract JDBC connnection from EntityManager
|
||||||
final Object dataSourceObj = entityManager.getEntityManagerFactory()
|
final Object dataSourceObj = entityManager.getEntityManagerFactory()
|
||||||
.getProperties().get("javax.persistence.jtaDataSource");
|
.getProperties().get("javax.persistence.jtaDataSource");
|
||||||
assertThat(dataSourceObj, is(instanceOf(DataSource.class)));
|
assertThat(dataSourceObj, is(instanceOf(DataSource.class)));
|
||||||
|
|
||||||
final DataSource dataSource = (DataSource) dataSourceObj;
|
final DataSource dataSource = (DataSource) dataSourceObj;
|
||||||
|
|
@ -132,28 +159,57 @@ public class CcmModulesTest {
|
||||||
assertThat(connection, is(instanceOf(Connection.class)));
|
assertThat(connection, is(instanceOf(Connection.class)));
|
||||||
|
|
||||||
//Check if the ccm_core.ccm_modules table exists.
|
//Check if the ccm_core.ccm_modules table exists.
|
||||||
final ResultSet ccmObjectTable = connection.getMetaData()
|
final ResultSet installedModules;
|
||||||
|
if ("H2".equals(connection.getMetaData().getDatabaseProductName())) {
|
||||||
|
final ResultSet ccmObjectTable = connection.getMetaData()
|
||||||
|
.getTables(null, "CCM_CORE", "CCM_OBJECTS", null);
|
||||||
|
if (!ccmObjectTable.next()) {
|
||||||
|
fail("No metadata for table ccm_core.ccm_objects returned. "
|
||||||
|
+ "Table does not exist?");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check of the ccm_core.installed_modules exists
|
||||||
|
final ResultSet installedModulesTable = connection.getMetaData()
|
||||||
|
.getTables(null, "CCM_CORE", "INSTALLED_MODULES", null);
|
||||||
|
if (!installedModulesTable.next()) {
|
||||||
|
fail(
|
||||||
|
"No metadata for table ccm_core.installed_modules returned. "
|
||||||
|
+ "Table does not exist?");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if the ccm-core module is registered in the
|
||||||
|
//ccm_core.installed_modules table
|
||||||
|
final Statement statement = connection.createStatement();
|
||||||
|
installedModules = statement.executeQuery(
|
||||||
|
"SELECT MODULE_ID, MODULE_CLASS_NAME, STATUS "
|
||||||
|
+ "FROM CCM_CORE.INSTALLED_MODULES"
|
||||||
|
+ " ORDER BY MODULE_CLASS_NAME");
|
||||||
|
} else {
|
||||||
|
final ResultSet ccmObjectTable = connection.getMetaData()
|
||||||
.getTables(null, "ccm_core", "ccm_objects", null);
|
.getTables(null, "ccm_core", "ccm_objects", null);
|
||||||
if (!ccmObjectTable.next()) {
|
if (!ccmObjectTable.next()) {
|
||||||
fail("No metadata for table ccm_core.ccm_objects returned. "
|
fail("No metadata for table ccm_core.ccm_objects returned. "
|
||||||
+ "Table does not exist?");
|
+ "Table does not exist?");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check of the ccm_core.installed_modules exists
|
//Check of the ccm_core.installed_modules exists
|
||||||
final ResultSet installedModulesTable = connection.getMetaData()
|
final ResultSet installedModulesTable = connection.getMetaData()
|
||||||
.getTables(null, "ccm_core", "installed_modules", null);
|
.getTables(null, "ccm_core", "installed_modules", null);
|
||||||
if (!installedModulesTable.next()) {
|
if (!installedModulesTable.next()) {
|
||||||
fail("No metadata for table ccm_core.installed_modules returned. "
|
fail(
|
||||||
+ "Table does not exist?");
|
"No metadata for table ccm_core.installed_modules returned. "
|
||||||
}
|
+ "Table does not exist?");
|
||||||
|
}
|
||||||
//Check if the ccm-core module is registered in the
|
|
||||||
//ccm_core.installed_modules table
|
//Check if the ccm-core module is registered in the
|
||||||
final Statement statement = connection.createStatement();
|
//ccm_core.installed_modules table
|
||||||
final ResultSet installedModules = statement.executeQuery(
|
final Statement statement = connection.createStatement();
|
||||||
|
installedModules = statement.executeQuery(
|
||||||
"SELECT module_id, module_class_name, status "
|
"SELECT module_id, module_class_name, status "
|
||||||
+ "FROM ccm_core.installed_modules"
|
+ "FROM ccm_core.installed_modules"
|
||||||
+ " ORDER BY module_class_name");
|
+ " ORDER BY module_class_name");
|
||||||
|
|
||||||
|
}
|
||||||
final List<InstalledModuleData> modulesData = new ArrayList<>();
|
final List<InstalledModuleData> modulesData = new ArrayList<>();
|
||||||
while (installedModules.next()) {
|
while (installedModules.next()) {
|
||||||
createInstalledModuleListEntry(installedModules, modulesData);
|
createInstalledModuleListEntry(installedModules, modulesData);
|
||||||
|
|
@ -163,44 +219,44 @@ public class CcmModulesTest {
|
||||||
|
|
||||||
assertThat(Integer.toString(modulesData.get(0).getModuleId()),
|
assertThat(Integer.toString(modulesData.get(0).getModuleId()),
|
||||||
is(equalTo(Integer.toString(CcmCore.class.getName().
|
is(equalTo(Integer.toString(CcmCore.class.getName().
|
||||||
hashCode()))));
|
hashCode()))));
|
||||||
assertThat(modulesData.get(0).getModuleClassName(),
|
assertThat(modulesData.get(0).getModuleClassName(),
|
||||||
is(equalTo(CcmCore.class.getName())));
|
is(equalTo(CcmCore.class.getName())));
|
||||||
assertThat(modulesData.get(0).getStatus(),
|
assertThat(modulesData.get(0).getStatus(),
|
||||||
is(equalTo(ModuleStatus.INSTALLED.toString())));
|
is(equalTo(ModuleStatus.INSTALLED.toString())));
|
||||||
|
|
||||||
//Check if the public user is registed.
|
//Check if the public user is registed.
|
||||||
final TypedQuery<User> userQuery = entityManager.createQuery(
|
final TypedQuery<User> userQuery = entityManager.createQuery(
|
||||||
"SELECT u FROM User u WHERE u.screenName = 'public-user'",
|
"SELECT u FROM User u WHERE u.screenName = 'public-user'",
|
||||||
User.class);
|
User.class);
|
||||||
final List<User> users = userQuery.getResultList();
|
final List<User> users = userQuery.getResultList();
|
||||||
|
|
||||||
assertThat(users.size(), is(1));
|
assertThat(users.size(), is(1));
|
||||||
assertThat(users.get(0).getScreenName(), is(equalTo("public-user")));
|
assertThat(users.get(0).getScreenName(), is(equalTo("public-user")));
|
||||||
assertThat(users.get(0).getName(), is(not(nullValue())));
|
assertThat(users.get(0).getName(), is(not(nullValue())));
|
||||||
assertThat(users.get(0).getName().getFamilyName(), is(equalTo("ccm")));
|
assertThat(users.get(0).getName().getFamilyName(), is(equalTo("ccm")));
|
||||||
assertThat(users.get(0).getName().getGivenName(),
|
assertThat(users.get(0).getName().getGivenName(),
|
||||||
is(equalTo("public user")));
|
is(equalTo("public user")));
|
||||||
assertThat(users.get(0).getEmailAddresses().size(), is(1));
|
assertThat(users.get(0).getEmailAddresses().size(), is(1));
|
||||||
assertThat(users.get(0).getEmailAddresses().get(0).getAddress(),
|
assertThat(users.get(0).getEmailAddresses().get(0).getAddress(),
|
||||||
is(equalTo("public-user@localhost")));
|
is(equalTo("public-user@localhost")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createInstalledModuleListEntry(
|
private void createInstalledModuleListEntry(
|
||||||
final ResultSet resultSet, final List<InstalledModuleData> modulesData)
|
final ResultSet resultSet, final List<InstalledModuleData> modulesData)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
|
|
||||||
final InstalledModuleData moduleData = new InstalledModuleData();
|
final InstalledModuleData moduleData = new InstalledModuleData();
|
||||||
moduleData.setModuleId(resultSet.getInt("module_id"));
|
moduleData.setModuleId(resultSet.getInt("module_id"));
|
||||||
moduleData.setModuleClassName(resultSet.getString("module_class_name"));
|
moduleData.setModuleClassName(resultSet.getString("module_class_name"));
|
||||||
moduleData.setStatus(resultSet.getString("status"));
|
moduleData.setStatus(resultSet.getString("status"));
|
||||||
|
|
||||||
modulesData.add(moduleData);
|
modulesData.add(moduleData);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class InstalledModuleData {
|
private class InstalledModuleData {
|
||||||
|
|
||||||
private int moduleId;
|
private int moduleId;
|
||||||
private String moduleClassName;
|
private String moduleClassName;
|
||||||
private String status;
|
private String status;
|
||||||
|
|
@ -228,6 +284,7 @@ public class CcmModulesTest {
|
||||||
public void setStatus(final String status) {
|
public void setStatus(final String status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@
|
||||||
</property>-->
|
</property>-->
|
||||||
|
|
||||||
<extension qualifier="persistence">
|
<extension qualifier="persistence">
|
||||||
<property name="defaultDataSource">java:/comp/env/jdbc/org/libreccm/ccm-test-bundle/h2-mem</property>
|
<property name="defaultDataSource">java:/comp/env/jdbc/org/libreccm/ccm-test-bundle/h2mem</property>
|
||||||
|
<!--<property name="defaultDataSource">java:/comp/env/jdbc/org/libreccm/ccm-test-bundle/h2</property>-->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Disable automatic cleanup, does not work because of referential
|
Disable automatic cleanup, does not work because of referential
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,6 @@
|
||||||
|
|
||||||
DROP SCHEMA IF EXISTS ccm_core;
|
DROP SCHEMA IF EXISTS ccm_core;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS schema_version;
|
||||||
|
|
||||||
DROP SEQUENCE IF EXISTS hibernate_sequence;
|
DROP SEQUENCE IF EXISTS hibernate_sequence;
|
||||||
|
|
@ -20,7 +20,8 @@
|
||||||
-->
|
-->
|
||||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||||
|
|
||||||
<jta-data-source>java:/comp/env/jdbc/org/libreccm/ccm-test-bundle/h2-mem</jta-data-source>
|
<jta-data-source>java:/comp/env/jdbc/org/libreccm/ccm-test-bundle/h2mem</jta-data-source>
|
||||||
|
<!--<jta-data-source>java:/comp/env/jdbc/org/libreccm/ccm-test-bundle/h2</jta-data-source>-->
|
||||||
<properties>
|
<properties>
|
||||||
<property name="hibernate.hbm2ddl.auto" value=""/>
|
<property name="hibernate.hbm2ddl.auto" value=""/>
|
||||||
<property name="hibernate.show_sql" value="true"/>
|
<property name="hibernate.show_sql" value="true"/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue