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