CCM NG:
- Removed GenericArticle entity, not useful anymore - DDL Scripts git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4186 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
749fb1e2ae
commit
9166673585
|
|
@ -28,6 +28,7 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.AssociationOverride;
|
||||
import javax.persistence.CollectionTable;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.ElementCollection;
|
||||
import javax.persistence.Embedded;
|
||||
|
|
@ -79,6 +80,12 @@ public class LegalMetadata extends Asset implements Serializable {
|
|||
private String creator;
|
||||
|
||||
@ElementCollection
|
||||
@CollectionTable(name = "LEGAL_METADATA_CONTRIBUTORS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "LEGAL_METADATA_ID")
|
||||
})
|
||||
@Column(name ="CONTRIBUTORS")
|
||||
private List<String> contributors;
|
||||
|
||||
public LegalMetadata() {
|
||||
|
|
|
|||
|
|
@ -20,9 +20,6 @@ package org.librecms.contentsection;
|
|||
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.hibernate.envers.RelationTargetAuditMode;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
import org.libreccm.core.CcmObject;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
import org.librecms.attachments.AttachmentList;
|
||||
|
|
@ -47,6 +44,8 @@ import javax.persistence.Table;
|
|||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
/**
|
||||
* Base type for all content item types. Specifies some common properties.
|
||||
*
|
||||
|
|
@ -134,7 +133,7 @@ public class ContentItem extends CcmObject implements Serializable {
|
|||
@OneToMany
|
||||
@JoinColumn(name = "CONTENT_ITEM_ID")
|
||||
private List<AttachmentList<?>> attachments;
|
||||
|
||||
|
||||
public LocalizedString getName() {
|
||||
return name;
|
||||
}
|
||||
|
|
@ -202,11 +201,11 @@ public class ContentItem extends CcmObject implements Serializable {
|
|||
public List<AttachmentList<?>> getAttachments() {
|
||||
return Collections.unmodifiableList(attachments);
|
||||
}
|
||||
|
||||
|
||||
protected void setAttachments(final List<AttachmentList<?>> attachments) {
|
||||
this.attachments = attachments;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = super.hashCode();
|
||||
|
|
|
|||
|
|
@ -19,9 +19,6 @@
|
|||
package org.librecms.contentsection;
|
||||
|
||||
import org.libreccm.categorization.Category;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
import org.libreccm.security.Role;
|
||||
import org.libreccm.web.CcmApplication;
|
||||
|
||||
|
|
@ -35,6 +32,8 @@ import javax.persistence.JoinColumn;
|
|||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class ContentType extends CcmObject implements Serializable {
|
|||
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "VALUES",
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "CONTENT_TYPE_LABELS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
|
|
@ -61,7 +61,7 @@ public class ContentType extends CcmObject implements Serializable {
|
|||
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "VALUES",
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "CONTENT_TYPE_DESCRIPTIONS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
|
|
|
|||
|
|
@ -20,16 +20,20 @@ package org.librecms.contenttypes;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.AssociationOverride;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
import org.librecms.contentsection.ContentItem;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:konerman@tzi.de">Alexander Konermann</a>
|
||||
|
|
@ -38,32 +42,32 @@ import static org.libreccm.core.CoreConstants.*;
|
|||
@Entity
|
||||
@Audited
|
||||
@Table(name = "ARTICLES", schema = DB_SCHEMA)
|
||||
public class Article extends GenericArticle implements Serializable {
|
||||
public class Article extends ContentItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3832010184748095822L;
|
||||
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "ARTICLE_LEADS",
|
||||
joinTable = @JoinTable(name = "ARTICLE_TEXTS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString lead;
|
||||
private LocalizedString text;
|
||||
|
||||
public LocalizedString getLead() {
|
||||
return lead;
|
||||
public LocalizedString getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setLead(final LocalizedString lead) {
|
||||
this.lead = lead;
|
||||
public void setText(final LocalizedString text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = super.hashCode();
|
||||
hash = 29 * hash + Objects.hashCode(lead);
|
||||
hash = 29 * hash + Objects.hashCode(text);
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +91,7 @@ public class Article extends GenericArticle implements Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
return Objects.equals(lead, other.getLead());
|
||||
return Objects.equals(text, other.getText());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -97,8 +101,8 @@ public class Article extends GenericArticle implements Serializable {
|
|||
|
||||
@Override
|
||||
public String toString(final String data) {
|
||||
return super.toString(String.format(", lead = %s%s",
|
||||
Objects.toString(lead),
|
||||
return super.toString(String.format(", text = %s%s",
|
||||
Objects.toString(text),
|
||||
data));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ package org.librecms.contenttypes;
|
|||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.AssociationOverride;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
|
|
@ -30,12 +31,15 @@ import javax.persistence.JoinTable;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
import org.librecms.contentsection.ContentItem;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:konerman@tzi.de">Alexander Konermann</a>
|
||||
|
|
@ -44,7 +48,7 @@ import static org.libreccm.core.CoreConstants.*;
|
|||
@Entity
|
||||
@Audited
|
||||
@Table(name = "EVENTS", schema = DB_SCHEMA)
|
||||
public class Event extends GenericArticle implements Serializable {
|
||||
public class Event extends ContentItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -9104886733503414635L;
|
||||
|
||||
|
|
@ -53,13 +57,13 @@ public class Event extends GenericArticle implements Serializable {
|
|||
*/
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "EVENT_LEADS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString lead;
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "EVENT_TEXTS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString text;
|
||||
|
||||
@Column(name = "START_DATE", nullable = false)
|
||||
@Temporal(TemporalType.DATE)
|
||||
|
|
@ -75,12 +79,12 @@ public class Event extends GenericArticle implements Serializable {
|
|||
*/
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "VALUES",
|
||||
joinTable = @JoinTable(name = "EVENT_DATES",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "EVENT_DATES",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString eventDate;
|
||||
|
||||
/**
|
||||
|
|
@ -88,12 +92,12 @@ public class Event extends GenericArticle implements Serializable {
|
|||
*/
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "VALUES",
|
||||
joinTable = @JoinTable(name = "EVENT_LOCATIONS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "EVENT_LOCATIONS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString location;
|
||||
|
||||
/**
|
||||
|
|
@ -101,22 +105,22 @@ public class Event extends GenericArticle implements Serializable {
|
|||
*/
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "VALUES",
|
||||
joinTable = @JoinTable(name = "EVENT_MAIN_CONTRIBUTORS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "EVENT_MAIN_CONTRIBUTORS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString mainContributor;
|
||||
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "VALUES",
|
||||
joinTable = @JoinTable(name = "EVENT_TYPES",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "EVENT_TYPES",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString eventType;
|
||||
|
||||
//ToDo: check if this is necessary or can be better handled using related links.
|
||||
|
|
@ -128,36 +132,36 @@ public class Event extends GenericArticle implements Serializable {
|
|||
*/
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "VALUES",
|
||||
joinTable = @JoinTable(name = "EVENT_COSTS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "EVENT_COSTS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString cost;
|
||||
|
||||
public LocalizedString getLead() {
|
||||
return lead;
|
||||
public LocalizedString getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setLead(final LocalizedString lead) {
|
||||
this.lead = lead;
|
||||
public void setText(final LocalizedString text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
return new Date(startDate.getTime());
|
||||
}
|
||||
|
||||
public void setStartDate(final Date startDate) {
|
||||
this.startDate = startDate;
|
||||
this.startDate = new Date(startDate.getTime());
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
return new Date(endDate.getTime());
|
||||
}
|
||||
|
||||
public void setEndDate(final Date endDate) {
|
||||
this.endDate = endDate;
|
||||
this.endDate = new Date(endDate.getTime());
|
||||
}
|
||||
|
||||
public LocalizedString getEventDate() {
|
||||
|
|
@ -211,7 +215,7 @@ public class Event extends GenericArticle implements Serializable {
|
|||
@Override
|
||||
public int hashCode() {
|
||||
int hash = super.hashCode();
|
||||
hash = 97 * hash + Objects.hashCode(lead);
|
||||
hash = 97 * hash + Objects.hashCode(text);
|
||||
hash = 97 * hash + Objects.hashCode(startDate);
|
||||
hash = 97 * hash + Objects.hashCode(endDate);
|
||||
hash = 97 * hash + Objects.hashCode(eventDate);
|
||||
|
|
@ -245,7 +249,7 @@ public class Event extends GenericArticle implements Serializable {
|
|||
if (!Objects.equals(mapLink, other.getMapLink())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(lead, other.getLead())) {
|
||||
if (!Objects.equals(text, other.getText())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(startDate, other.getStartDate())) {
|
||||
|
|
@ -276,16 +280,16 @@ public class Event extends GenericArticle implements Serializable {
|
|||
|
||||
@Override
|
||||
public String toString(final String data) {
|
||||
return super.toString(String.format(", lead = %s, "
|
||||
+ "startDate = %tF %<tT, "
|
||||
+ "endDate = %tF %<tT, "
|
||||
+ "eventDate = %s, "
|
||||
+ "location = %s,"
|
||||
+ "mainContributor, %s, "
|
||||
+ "eventType = %s, "
|
||||
+ "mapLink = \"%s\", "
|
||||
+ "cost = %s%s",
|
||||
Objects.toString(lead),
|
||||
return super.toString(String.format(", text = %s, "
|
||||
+ "startDate = %tF %<tT, "
|
||||
+ "endDate = %tF %<tT, "
|
||||
+ "eventDate = %s, "
|
||||
+ "location = %s,"
|
||||
+ "mainContributor, %s, "
|
||||
+ "eventType = %s, "
|
||||
+ "mapLink = \"%s\", "
|
||||
+ "cost = %s%s",
|
||||
Objects.toString(text),
|
||||
startDate,
|
||||
endDate,
|
||||
Objects.toString(eventDate),
|
||||
|
|
@ -296,4 +300,5 @@ public class Event extends GenericArticle implements Serializable {
|
|||
Objects.toString(cost),
|
||||
data));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2015 LibreCCM Foundation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
package org.librecms.contenttypes;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import javax.persistence.AssociationOverride;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.Table;
|
||||
import org.hibernate.envers.Audited;
|
||||
|
||||
|
||||
import org.librecms.contentsection.ContentItem;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
/**
|
||||
* Base class for article like content items. These items usually contain a
|
||||
* short introduction text (the description) and a longer text containing
|
||||
* the more detailed content.
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Audited
|
||||
@Table(name = "GENERIC_ARTICLES", schema = DB_SCHEMA)
|
||||
public class GenericArticle extends ContentItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6737443527969703121L;
|
||||
|
||||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "ARTICLE_TEXTS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString text;
|
||||
|
||||
public LocalizedString getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(final LocalizedString text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = super.hashCode();
|
||||
hash = 17 * hash + Objects.hashCode(text);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof GenericArticle)) {
|
||||
return false;
|
||||
}
|
||||
final GenericArticle other = (GenericArticle) obj;
|
||||
if(!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Objects.equals(text, other.getText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof GenericArticle;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -18,8 +18,6 @@
|
|||
*/
|
||||
package org.librecms.contenttypes;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
import org.librecms.contentsection.ContentItem;
|
||||
|
|
@ -38,6 +36,8 @@ import javax.persistence.JoinTable;
|
|||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
*/
|
||||
package org.librecms.contenttypes;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
|
|
@ -37,6 +35,8 @@ import javax.persistence.JoinColumn;
|
|||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
/**
|
||||
* A section of a MultiPartArticle
|
||||
*
|
||||
|
|
@ -44,7 +44,7 @@ import javax.persistence.Table;
|
|||
*/
|
||||
@Entity
|
||||
@Audited
|
||||
@Table(name = "MULTIPART_ARTICLE_SECTIONS")
|
||||
@Table(name = "MULTIPART_ARTICLE_SECTIONS", schema = DB_SCHEMA)
|
||||
public class MultiPartArticleSection implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1109186628988745920L;
|
||||
|
|
|
|||
|
|
@ -18,9 +18,15 @@
|
|||
*/
|
||||
package org.librecms.contenttypes;
|
||||
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
import org.librecms.contentsection.ContentItem;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.persistence.AssociationOverride;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
|
|
@ -30,11 +36,8 @@ import javax.persistence.JoinTable;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import org.hibernate.envers.Audited;
|
||||
import org.hibernate.validator.constraints.NotEmpty;
|
||||
import org.libreccm.l10n.LocalizedString;
|
||||
|
||||
import static org.libreccm.core.CoreConstants.*;
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:konerman@tzi.de">Alexander Konermann</a>
|
||||
|
|
@ -43,7 +46,7 @@ import static org.libreccm.core.CoreConstants.*;
|
|||
@Entity
|
||||
@Audited
|
||||
@Table(name = "NEWS", schema = DB_SCHEMA)
|
||||
public class News extends GenericArticle implements Serializable {
|
||||
public class News extends ContentItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4939565845920227974L;
|
||||
|
||||
|
|
@ -53,12 +56,12 @@ public class News extends GenericArticle implements Serializable {
|
|||
@Embedded
|
||||
@AssociationOverride(
|
||||
name = "values",
|
||||
joinTable = @JoinTable(name = "NEWS_LEADS",
|
||||
joinTable = @JoinTable(name = "NEWS_TEXTS",
|
||||
schema = DB_SCHEMA,
|
||||
joinColumns = {
|
||||
@JoinColumn(name = "OBJECT_ID")}
|
||||
))
|
||||
private LocalizedString lead;
|
||||
private LocalizedString text;
|
||||
|
||||
/**
|
||||
* Release date of the news
|
||||
|
|
@ -76,12 +79,12 @@ public class News extends GenericArticle implements Serializable {
|
|||
@NotEmpty
|
||||
private boolean homepage;
|
||||
|
||||
public LocalizedString getLead() {
|
||||
return lead;
|
||||
public LocalizedString getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setLead(final LocalizedString lead) {
|
||||
this.lead = lead;
|
||||
public void setText(final LocalizedString text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public Date getReleaseDate() {
|
||||
|
|
@ -103,7 +106,7 @@ public class News extends GenericArticle implements Serializable {
|
|||
@Override
|
||||
public int hashCode() {
|
||||
int hash = super.hashCode();
|
||||
hash = 11 * hash + Objects.hashCode(this.lead);
|
||||
hash = 11 * hash + Objects.hashCode(this.text);
|
||||
hash = 11 * hash + Objects.hashCode(this.releaseDate);
|
||||
hash = 11 * hash + (this.homepage ? 1 : 0);
|
||||
return hash;
|
||||
|
|
@ -130,7 +133,7 @@ public class News extends GenericArticle implements Serializable {
|
|||
if (homepage != other.isHomepage()) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(lead, other.getLead())) {
|
||||
if (!Objects.equals(text, other.getText())) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(releaseDate, other.getReleaseDate());
|
||||
|
|
@ -143,10 +146,10 @@ public class News extends GenericArticle implements Serializable {
|
|||
|
||||
@Override
|
||||
public String toString(final String data) {
|
||||
return super.toString(String.format(", lead = \"%s\", "
|
||||
return super.toString(String.format(", text = %s, "
|
||||
+ "releaseDate = %tF %<tT, "
|
||||
+ "homepage = %b%d",
|
||||
Objects.toString(lead),
|
||||
Objects.toString(text),
|
||||
releaseDate,
|
||||
homepage,
|
||||
data));
|
||||
|
|
|
|||
|
|
@ -34,12 +34,14 @@ import javax.persistence.Table;
|
|||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
import static org.librecms.CmsConstants.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "LIFECYLE_PHASES")
|
||||
@Table(name = "LIFECYLE_PHASES", schema = DB_SCHEMA)
|
||||
public class Phase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1683874069942019941L;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue