Reworked inhertiance hierarchy for PublicationItems, CreateForms for
PublicationItemspull/1/head
parent
5d653ee61b
commit
cf5d3fb5e3
|
|
@ -0,0 +1,61 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.FormData;
|
||||||
|
import com.arsdigita.bebop.PageState;
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
import com.arsdigita.cms.ui.authoring.PageCreateForm;
|
||||||
|
|
||||||
|
import org.librecms.contentsection.ContentItemInitializer;
|
||||||
|
import org.scientificcms.publications.Publication;
|
||||||
|
import org.scientificcms.publications.contenttypes.PublicationItem;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
* @param <P>
|
||||||
|
* @param <T>
|
||||||
|
*/
|
||||||
|
public abstract class AbstractPublicationCreateForm<P extends Publication, T extends PublicationItem<P>>
|
||||||
|
extends PageCreateForm {
|
||||||
|
|
||||||
|
public AbstractPublicationCreateForm(
|
||||||
|
final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam
|
||||||
|
) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
protected ContentItemInitializer<?> getItemInitializer(
|
||||||
|
final FormData data, final PageState state) {
|
||||||
|
|
||||||
|
return item -> ((T) item).setPublication(
|
||||||
|
createPublication(data)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected P createPublication(final FormData data) {
|
||||||
|
|
||||||
|
final Locale locale = new Locale((String) data.get(LANGUAGE));
|
||||||
|
final String title = (String) data.get(TITLE);
|
||||||
|
|
||||||
|
final P publication = createPublication();
|
||||||
|
publication.getTitle().addValue(locale, title);
|
||||||
|
|
||||||
|
return publication;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract P createPublication();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.ArticleInCollectedVolume;
|
||||||
|
import org.scientificcms.publications.contenttypes.ArticleInCollectedVolumeItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class ArticleInCollectedVolumeCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<ArticleInCollectedVolume, ArticleInCollectedVolumeItem> {
|
||||||
|
|
||||||
|
public ArticleInCollectedVolumeCreateForm(
|
||||||
|
final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam
|
||||||
|
) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ArticleInCollectedVolume createPublication() {
|
||||||
|
return new ArticleInCollectedVolume();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.ArticleInJournal;
|
||||||
|
import org.scientificcms.publications.contenttypes.ArticleInJournalItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class ArticleInJournalCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<ArticleInJournal, ArticleInJournalItem> {
|
||||||
|
|
||||||
|
public ArticleInJournalCreateForm(
|
||||||
|
final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam
|
||||||
|
) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ArticleInJournal createPublication() {
|
||||||
|
return new ArticleInJournal();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.CollectedVolume;
|
||||||
|
import org.scientificcms.publications.Publication;
|
||||||
|
import org.scientificcms.publications.contenttypes.CollectedVolumeItem;
|
||||||
|
import org.scientificcms.publications.contenttypes.PublicationItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class CollectedVolumeCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<CollectedVolume, CollectedVolumeItem> {
|
||||||
|
|
||||||
|
public CollectedVolumeCreateForm(
|
||||||
|
final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam
|
||||||
|
) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected CollectedVolume createPublication() {
|
||||||
|
return new CollectedVolume();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.Expertise;
|
||||||
|
import org.scientificcms.publications.contenttypes.ExpertiseItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class ExpertiseCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<Expertise, ExpertiseItem>{
|
||||||
|
|
||||||
|
public ExpertiseCreateForm(final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Expertise createPublication() {
|
||||||
|
return new Expertise();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.GreyLiterature;
|
||||||
|
import org.scientificcms.publications.contenttypes.GreyLiteratureItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class GreyLiteratureCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<GreyLiterature, GreyLiteratureItem> {
|
||||||
|
|
||||||
|
public GreyLiteratureCreateForm(
|
||||||
|
final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam
|
||||||
|
) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected GreyLiterature createPublication() {
|
||||||
|
return new GreyLiterature();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.InProceedings;
|
||||||
|
import org.scientificcms.publications.contenttypes.InProceedingsItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class InProceedingsCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<InProceedings, InProceedingsItem> {
|
||||||
|
|
||||||
|
public InProceedingsCreateForm(final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected InProceedings createPublication() {
|
||||||
|
return new InProceedings();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.InternetArticle;
|
||||||
|
import org.scientificcms.publications.contenttypes.InternetArticleItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class InternetArticleCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<InternetArticle, InternetArticleItem> {
|
||||||
|
|
||||||
|
public InternetArticleCreateForm(
|
||||||
|
final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam
|
||||||
|
) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected InternetArticle createPublication() {
|
||||||
|
return new InternetArticle();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.Monograph;
|
||||||
|
import org.scientificcms.publications.contenttypes.MonographItem;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class MonographCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<Monograph, MonographItem> {
|
||||||
|
|
||||||
|
public MonographCreateForm(final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Monograph createPublication() {
|
||||||
|
return new Monograph();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.Proceedings;
|
||||||
|
import org.scientificcms.publications.contenttypes.ProceedingsItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class ProceedingsCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<Proceedings, ProceedingsItem>{
|
||||||
|
|
||||||
|
public ProceedingsCreateForm(final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Proceedings createPublication() {
|
||||||
|
return new Proceedings();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.Talk;
|
||||||
|
import org.scientificcms.publications.contenttypes.TalkItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class TalkCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<Talk, TalkItem> {
|
||||||
|
|
||||||
|
public TalkCreateForm(final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Talk createPublication() {
|
||||||
|
return new Talk();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
import org.scientificcms.publications.WorkingPaper;
|
||||||
|
import org.scientificcms.publications.contenttypes.WorkingPaperItem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class WorkingPaperCreateForm
|
||||||
|
extends AbstractPublicationCreateForm<WorkingPaper, WorkingPaperItem> {
|
||||||
|
|
||||||
|
public WorkingPaperCreateForm(final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector creationSelector,
|
||||||
|
final StringParameter selectedLanguageParam) {
|
||||||
|
super(itemModel, creationSelector, selectedLanguageParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected WorkingPaper createPublication() {
|
||||||
|
return new WorkingPaper();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -169,7 +169,7 @@ public class PublicationManager {
|
||||||
.filter(authorship -> authorship.getAuthor().equals(author))
|
.filter(authorship -> authorship.getAuthor().equals(author))
|
||||||
.findAny();
|
.findAny();
|
||||||
|
|
||||||
if (result.isEmpty()) {
|
if (!result.isPresent()) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
String.format(
|
String.format(
|
||||||
"Person %s is not an author of the publication %s.",
|
"Person %s is not an author of the publication %s.",
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class CollectedVolumeAsset extends Asset {
|
||||||
return collectedVolume;
|
return collectedVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setCollectedVolume(final CollectedVolume collectedVolume) {
|
public void setCollectedVolume(final CollectedVolume collectedVolume) {
|
||||||
this.collectedVolume = collectedVolume;
|
this.collectedVolume = collectedVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class JournalAsset extends Asset {
|
||||||
return journal;
|
return journal;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setJournal(final Journal journal) {
|
public void setJournal(final Journal journal) {
|
||||||
this.journal = journal;
|
this.journal = journal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public class PublisherAsset extends Asset {
|
||||||
return publisher;
|
return publisher;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setPublisher(final Publisher publisher) {
|
public void setPublisher(final Publisher publisher) {
|
||||||
this.publisher = publisher;
|
this.publisher = publisher;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,32 +26,32 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Table(name = "ARTICLE_IN_COLLECTED_VOLUME_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "ARTICLE_IN_COLLECTED_VOLUME_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public class ArticleInCollectedVolumeItem
|
public class ArticleInCollectedVolumeItem
|
||||||
extends AbstractPublicationItem<ArticleInCollectedVolume> {
|
extends PublicationItem<ArticleInCollectedVolume> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "ARTICLE_ID")
|
// @JoinColumn(name = "ARTICLE_ID")
|
||||||
private ArticleInCollectedVolume article;
|
// private ArticleInCollectedVolume article;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public ArticleInCollectedVolume getPublication() {
|
// public ArticleInCollectedVolume getPublication() {
|
||||||
return article;
|
// return article;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final ArticleInCollectedVolume article) {
|
// protected void setPublication(final ArticleInCollectedVolume article) {
|
||||||
this.article = article;
|
// this.article = article;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 67 * hash + Objects.hashCode(article);
|
// hash = 67 * hash + Objects.hashCode(article);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,10 +71,11 @@ public class ArticleInCollectedVolumeItem
|
||||||
}
|
}
|
||||||
final ArticleInCollectedVolumeItem other
|
final ArticleInCollectedVolumeItem other
|
||||||
= (ArticleInCollectedVolumeItem) obj;
|
= (ArticleInCollectedVolumeItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(article, other.getPublication());
|
// return Objects.equals(article, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,11 +83,11 @@ public class ArticleInCollectedVolumeItem
|
||||||
return obj instanceof ArticleInCollectedVolumeItem;
|
return obj instanceof ArticleInCollectedVolumeItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", article = %s%s",
|
// return super.toString(String.format(", article = %s%s",
|
||||||
Objects.toString(article),
|
// Objects.toString(article),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,7 @@ package org.scientificcms.publications.contenttypes;
|
||||||
import org.hibernate.envers.Audited;
|
import org.hibernate.envers.Audited;
|
||||||
import org.scientificcms.publications.ArticleInJournal;
|
import org.scientificcms.publications.ArticleInJournal;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.OneToOne;
|
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
|
|
@ -25,33 +20,30 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "ARTICLE_IN_COLLECTED_VOLUME_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "ARTICLE_IN_COLLECTED_VOLUME_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public class ArticleInJournalItem
|
public class ArticleInJournalItem extends PublicationItem<ArticleInJournal> {
|
||||||
extends AbstractPublicationItem<ArticleInJournal> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "ARTICLE_ID")
|
// @JoinColumn(name = "ARTICLE_ID")
|
||||||
private ArticleInJournal article;
|
// private ArticleInJournal article;
|
||||||
|
// @Override
|
||||||
@Override
|
// public ArticleInJournal getPublication() {
|
||||||
public ArticleInJournal getPublication() {
|
// return article;
|
||||||
return article;
|
// }
|
||||||
}
|
//
|
||||||
|
// @Override
|
||||||
@Override
|
// protected void setPublication(final ArticleInJournal article) {
|
||||||
protected void setPublication(final ArticleInJournal article) {
|
// this.article = article;
|
||||||
this.article = article;
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 67 * hash + Objects.hashCode(this.article);
|
// hash = 67 * hash + Objects.hashCode(this.article);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,11 +62,12 @@ public class ArticleInJournalItem
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final ArticleInJournalItem other
|
final ArticleInJournalItem other
|
||||||
= (ArticleInJournalItem) obj;
|
= (ArticleInJournalItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(this.article, other.getPublication());
|
// return Objects.equals(this.article, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,11 +75,11 @@ public class ArticleInJournalItem
|
||||||
return obj instanceof ArticleInJournalItem;
|
return obj instanceof ArticleInJournalItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", article = %s%s",
|
// return super.toString(String.format(", article = %s%s",
|
||||||
Objects.toString(article),
|
// Objects.toString(article),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,32 +27,32 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Table(name = "COLLECTED_VOLUME_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "COLLECTED_VOLUME_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public class CollectedVolumeItem
|
public class CollectedVolumeItem
|
||||||
extends AbstractPublicationWithPublisherItem<CollectedVolume> {
|
extends PublicationWithPublisherItem<CollectedVolume> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "COLLECTED_VOLUME_ID")
|
// @JoinColumn(name = "COLLECTED_VOLUME_ID")
|
||||||
private CollectedVolume collectedVolume;
|
// private CollectedVolume collectedVolume;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public CollectedVolume getPublication() {
|
// public CollectedVolume getPublication() {
|
||||||
return collectedVolume;
|
// return collectedVolume;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final CollectedVolume collectedVolume) {
|
// protected void setPublication(final CollectedVolume collectedVolume) {
|
||||||
this.collectedVolume = collectedVolume;
|
// this.collectedVolume = collectedVolume;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 59 * hash + Objects.hashCode(collectedVolume);
|
// hash = 59 * hash + Objects.hashCode(collectedVolume);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,10 +71,11 @@ public class CollectedVolumeItem
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final CollectedVolumeItem other = (CollectedVolumeItem) obj;
|
final CollectedVolumeItem other = (CollectedVolumeItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(collectedVolume, other.getPublication());
|
// return Objects.equals(collectedVolume, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,11 +83,11 @@ public class CollectedVolumeItem
|
||||||
return obj instanceof CollectedVolumeItem;
|
return obj instanceof CollectedVolumeItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", collectedVolume = %s%s",
|
// return super.toString(String.format(", collectedVolume = %s%s",
|
||||||
Objects.toString(collectedVolume),
|
// Objects.toString(collectedVolume),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,33 +25,32 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "EXPERTISE_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "EXPERTISE_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public class ExpertiseItem
|
public class ExpertiseItem extends PublicationItem<Expertise> {
|
||||||
extends AbstractPublicationItem<Expertise> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "EXPERTISE_ID")
|
// @JoinColumn(name = "EXPERTISE_ID")
|
||||||
private Expertise expertise;
|
// private Expertise expertise;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public Expertise getPublication() {
|
// public Expertise getPublication() {
|
||||||
return expertise;
|
// return expertise;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final Expertise expertise) {
|
// protected void setPublication(final Expertise expertise) {
|
||||||
this.expertise = expertise;
|
// this.expertise = expertise;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 67 * hash + Objects.hashCode(expertise);
|
// hash = 67 * hash + Objects.hashCode(expertise);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,10 +70,11 @@ public class ExpertiseItem
|
||||||
}
|
}
|
||||||
final ExpertiseItem other
|
final ExpertiseItem other
|
||||||
= (ExpertiseItem) obj;
|
= (ExpertiseItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(this.expertise, other.getPublication());
|
// return Objects.equals(this.expertise, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,11 +82,11 @@ public class ExpertiseItem
|
||||||
return obj instanceof ExpertiseItem;
|
return obj instanceof ExpertiseItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", expertise = %s%s",
|
// return super.toString(String.format(", expertise = %s%s",
|
||||||
Objects.toString(expertise),
|
// Objects.toString(expertise),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,33 +25,31 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "GREY_LITERATURE_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "GREY_LITERATURE_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public class GreyLiteratureItem
|
public class GreyLiteratureItem extends PublicationItem<GreyLiterature> {
|
||||||
extends AbstractPublicationItem<GreyLiterature> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "GREY_LITERATURE_ID")
|
// @JoinColumn(name = "GREY_LITERATURE_ID")
|
||||||
private GreyLiterature greyLiterature;
|
// private GreyLiterature greyLiterature;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public GreyLiterature getPublication() {
|
// public GreyLiterature getPublication() {
|
||||||
return greyLiterature;
|
// return greyLiterature;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final GreyLiterature greyLiterature) {
|
// protected void setPublication(final GreyLiterature greyLiterature) {
|
||||||
this.greyLiterature = greyLiterature;
|
// this.greyLiterature = greyLiterature;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 67 * hash + Objects.hashCode(greyLiterature);
|
// hash = 67 * hash + Objects.hashCode(greyLiterature);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,11 +68,12 @@ public class GreyLiteratureItem
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final GreyLiteratureItem other
|
final GreyLiteratureItem other
|
||||||
= (GreyLiteratureItem) obj;
|
= (GreyLiteratureItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(this.greyLiterature, other.getPublication());
|
// return Objects.equals(this.greyLiterature, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,11 +81,11 @@ public class GreyLiteratureItem
|
||||||
return obj instanceof GreyLiteratureItem;
|
return obj instanceof GreyLiteratureItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", greyLiterature = %s%s",
|
// return super.toString(String.format(", greyLiterature = %s%s",
|
||||||
Objects.toString(greyLiterature),
|
// Objects.toString(greyLiterature),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,33 +25,32 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "INPROCEEDINGS_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "INPROCEEDINGS_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public class InProceedingsItem
|
public class InProceedingsItem extends PublicationItem<InProceedings> {
|
||||||
extends AbstractPublicationItem<InProceedings> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "INPROCEEDINGS_ID")
|
// @JoinColumn(name = "INPROCEEDINGS_ID")
|
||||||
private InProceedings inProcedings;
|
// private InProceedings inProcedings;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public InProceedings getPublication() {
|
// public InProceedings getPublication() {
|
||||||
return inProcedings;
|
// return inProcedings;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final InProceedings inProceedings) {
|
// protected void setPublication(final InProceedings inProceedings) {
|
||||||
this.inProcedings = inProceedings;
|
// this.inProcedings = inProceedings;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 67 * hash + Objects.hashCode(inProcedings);
|
// hash = 67 * hash + Objects.hashCode(inProcedings);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -70,11 +69,12 @@ public class InProceedingsItem
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final InProceedingsItem other
|
final InProceedingsItem other
|
||||||
= (InProceedingsItem) obj;
|
= (InProceedingsItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(this.inProcedings, other.getPublication());
|
// return Objects.equals(this.inProcedings, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,11 +82,11 @@ public class InProceedingsItem
|
||||||
return obj instanceof InProceedingsItem;
|
return obj instanceof InProceedingsItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", inProceedings = %s%s",
|
// return super.toString(String.format(", inProceedings = %s%s",
|
||||||
Objects.toString(inProcedings),
|
// Objects.toString(inProcedings),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,33 +25,31 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "INTERNET_ARTICLE_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "INTERNET_ARTICLE_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public class InternetArticleItem
|
public class InternetArticleItem extends PublicationItem<InternetArticle> {
|
||||||
extends AbstractPublicationItem<InternetArticle> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "EXPERTISE_ID")
|
// @JoinColumn(name = "EXPERTISE_ID")
|
||||||
private InternetArticle expertise;
|
// private InternetArticle expertise;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public InternetArticle getPublication() {
|
// public InternetArticle getPublication() {
|
||||||
return expertise;
|
// return expertise;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final InternetArticle internetArticle) {
|
// protected void setPublication(final InternetArticle internetArticle) {
|
||||||
this.expertise = internetArticle;
|
// this.expertise = internetArticle;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 67 * hash + Objects.hashCode(expertise);
|
// hash = 67 * hash + Objects.hashCode(expertise);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,10 +69,11 @@ public class InternetArticleItem
|
||||||
}
|
}
|
||||||
final InternetArticleItem other
|
final InternetArticleItem other
|
||||||
= (InternetArticleItem) obj;
|
= (InternetArticleItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(this.expertise, other.getPublication());
|
// return Objects.equals(this.expertise, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,11 +81,11 @@ public class InternetArticleItem
|
||||||
return obj instanceof InternetArticleItem;
|
return obj instanceof InternetArticleItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", internetArticle = %s%s",
|
// return super.toString(String.format(", internetArticle = %s%s",
|
||||||
Objects.toString(expertise),
|
// Objects.toString(expertise),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,7 @@ package org.scientificcms.publications.contenttypes;
|
||||||
|
|
||||||
import org.scientificcms.publications.Monograph;
|
import org.scientificcms.publications.Monograph;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.OneToOne;
|
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
|
|
@ -23,33 +18,31 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "MONOGRAPH_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "MONOGRAPH_ITEMS", schema = DB_SCHEMA)
|
||||||
public class MonographItem
|
public class MonographItem extends PublicationWithPublisherItem<Monograph> {
|
||||||
extends AbstractPublicationWithPublisherItem<Monograph> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "MONOGRAPH_ID")
|
// @JoinColumn(name = "MONOGRAPH_ID")
|
||||||
private Monograph monograph;
|
// private Monograph monograph;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public Monograph getPublication() {
|
// public Monograph getPublication() {
|
||||||
return monograph;
|
// return monograph;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final Monograph monograph) {
|
// protected void setPublication(final Monograph monograph) {
|
||||||
this.monograph = monograph;
|
// this.monograph = monograph;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 29 * hash + Objects.hashCode(monograph);
|
// hash = 29 * hash + Objects.hashCode(monograph);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,10 +61,11 @@ public class MonographItem
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final MonographItem other = (MonographItem) obj;
|
final MonographItem other = (MonographItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(monograph, other.getPublication());
|
// return Objects.equals(monograph, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -79,11 +73,11 @@ public class MonographItem
|
||||||
return obj instanceof MonographItem;
|
return obj instanceof MonographItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", publication = %s%s",
|
// return super.toString(String.format(", publication = %s%s",
|
||||||
Objects.toString(monograph),
|
// Objects.toString(monograph),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,7 @@ package org.scientificcms.publications.contenttypes;
|
||||||
|
|
||||||
import org.scientificcms.publications.Proceedings;
|
import org.scientificcms.publications.Proceedings;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.OneToOne;
|
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
|
|
@ -23,33 +18,31 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "PROCEEDINGS_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "PROCEEDINGS_ITEMS", schema = DB_SCHEMA)
|
||||||
public class ProceedingsItem
|
public class ProceedingsItem extends PublicationWithPublisherItem<Proceedings> {
|
||||||
extends AbstractPublicationWithPublisherItem<Proceedings> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "PROCEEDINGS_ID")
|
// @JoinColumn(name = "PROCEEDINGS_ID")
|
||||||
private Proceedings article;
|
// private Proceedings article;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public Proceedings getPublication() {
|
// public Proceedings getPublication() {
|
||||||
return article;
|
// return article;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final Proceedings article) {
|
// protected void setPublication(final Proceedings article) {
|
||||||
this.article = article;
|
// this.article = article;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 67 * hash + Objects.hashCode(article);
|
// hash = 67 * hash + Objects.hashCode(article);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,10 +62,11 @@ public class ProceedingsItem
|
||||||
}
|
}
|
||||||
final ProceedingsItem other
|
final ProceedingsItem other
|
||||||
= (ProceedingsItem) obj;
|
= (ProceedingsItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(this.article, other.getPublication());
|
// return Objects.equals(this.article, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -80,11 +74,11 @@ public class ProceedingsItem
|
||||||
return obj instanceof ProceedingsItem;
|
return obj instanceof ProceedingsItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", proceedings = %s%s",
|
// return super.toString(String.format(", proceedings = %s%s",
|
||||||
Objects.toString(article),
|
// Objects.toString(article),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,18 @@ import org.hibernate.envers.Audited;
|
||||||
import org.librecms.contentsection.ContentItem;
|
import org.librecms.contentsection.ContentItem;
|
||||||
import org.scientificcms.publications.Publication;
|
import org.scientificcms.publications.Publication;
|
||||||
|
|
||||||
|
import javax.persistence.CascadeType;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.FetchType;
|
||||||
|
import javax.persistence.NamedQueries;
|
||||||
|
import javax.persistence.NamedQuery;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Base Item for Publications.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
|
@ -22,14 +28,32 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "PUBLICATION_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "PUBLICATION_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public abstract class AbstractPublicationItem<T extends Publication>
|
@NamedQueries({
|
||||||
extends ContentItem {
|
@NamedQuery(
|
||||||
|
name = "PublicationItem.findForPublication",
|
||||||
|
query = "SELECT i FROM PublicationItem i WHERE i.publication = :publication"
|
||||||
|
)
|
||||||
|
})
|
||||||
|
public class PublicationItem<T extends Publication> extends ContentItem {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public abstract T getPublication();
|
@OneToOne(cascade = {CascadeType.DETACH,
|
||||||
|
CascadeType.MERGE,
|
||||||
|
CascadeType.PERSIST,
|
||||||
|
CascadeType.REFRESH},
|
||||||
|
fetch = FetchType.LAZY,
|
||||||
|
targetEntity = Publication.class
|
||||||
|
)
|
||||||
|
private T publication;
|
||||||
|
|
||||||
protected abstract void setPublication(T publication);
|
public T getPublication() {
|
||||||
|
return publication;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPublication(final T publication) {
|
||||||
|
this.publication = publication;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
|
@ -49,18 +73,17 @@ public abstract class AbstractPublicationItem<T extends Publication>
|
||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(obj instanceof AbstractPublicationItem)) {
|
if (!(obj instanceof PublicationItem)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final AbstractPublicationItem<?> other
|
final PublicationItem<?> other = (PublicationItem<?>) obj;
|
||||||
= (AbstractPublicationItem<?>) obj;
|
|
||||||
return other.canEqual(this);
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canEqual(final Object obj) {
|
public boolean canEqual(final Object obj) {
|
||||||
|
|
||||||
return obj instanceof AbstractPublicationItem;
|
return obj instanceof PublicationItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package org.scientificcms.publications.contenttypes;
|
||||||
|
|
||||||
|
import org.librecms.contentsection.ContentItemRepository;
|
||||||
|
import org.scientificcms.publications.Publication;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import javax.persistence.NoResultException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class PublicationItemRepository extends ContentItemRepository {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public <T extends Publication> Optional<PublicationItem<T>> findForPublication(
|
||||||
|
final T publication, final Class<T> publicationType
|
||||||
|
) {
|
||||||
|
try {
|
||||||
|
return Optional.of(
|
||||||
|
(PublicationItem<T>) getEntityManager()
|
||||||
|
.createNamedQuery("PublicationItem.findForPublication",
|
||||||
|
PublicationItem.class)
|
||||||
|
.setParameter("publication", publication)
|
||||||
|
.getSingleResult()
|
||||||
|
);
|
||||||
|
} catch (NoResultException ex) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -21,8 +21,8 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "PUBLICATION_WITH_PUBLISHER_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "PUBLICATION_WITH_PUBLISHER_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public abstract class AbstractPublicationWithPublisherItem<T extends PublicationWithPublisher>
|
public class PublicationWithPublisherItem<T extends PublicationWithPublisher>
|
||||||
extends AbstractPublicationItem<T> {
|
extends PublicationItem<T> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
@ -44,17 +44,17 @@ public abstract class AbstractPublicationWithPublisherItem<T extends Publication
|
||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!(obj instanceof AbstractPublicationWithPublisherItem)) {
|
if (!(obj instanceof PublicationWithPublisherItem)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final AbstractPublicationWithPublisherItem<?> other
|
final PublicationWithPublisherItem<?> other
|
||||||
= (AbstractPublicationWithPublisherItem<?>) obj;
|
= (PublicationWithPublisherItem<?>) obj;
|
||||||
return other.canEqual(this);
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canEqual(final Object obj) {
|
public boolean canEqual(final Object obj) {
|
||||||
return obj instanceof AbstractPublicationWithPublisherItem;
|
return obj instanceof PublicationWithPublisherItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -25,33 +25,31 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "TALK_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "TALK_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public class TalkItem
|
public class TalkItem extends PublicationItem<Talk> {
|
||||||
extends AbstractPublicationItem<Talk> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "TALK_ID")
|
// @JoinColumn(name = "TALK_ID")
|
||||||
private Talk talk;
|
// private Talk talk;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public Talk getPublication() {
|
// public Talk getPublication() {
|
||||||
return talk;
|
// return talk;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final Talk talk) {
|
// protected void setPublication(final Talk talk) {
|
||||||
this.talk = talk;
|
// this.talk = talk;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 67 * hash + Objects.hashCode(talk);
|
// hash = 67 * hash + Objects.hashCode(talk);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,10 +69,11 @@ public class TalkItem
|
||||||
}
|
}
|
||||||
final TalkItem other
|
final TalkItem other
|
||||||
= (TalkItem) obj;
|
= (TalkItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(this.talk, other.getPublication());
|
// return Objects.equals(this.talk, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,11 +81,11 @@ public class TalkItem
|
||||||
return obj instanceof TalkItem;
|
return obj instanceof TalkItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", talk = %s%s",
|
// return super.toString(String.format(", talk = %s%s",
|
||||||
Objects.toString(talk),
|
// Objects.toString(talk),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,7 @@ package org.scientificcms.publications.contenttypes;
|
||||||
import org.hibernate.envers.Audited;
|
import org.hibernate.envers.Audited;
|
||||||
import org.scientificcms.publications.WorkingPaper;
|
import org.scientificcms.publications.WorkingPaper;
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
import javax.persistence.CascadeType;
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.OneToOne;
|
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
|
|
@ -25,33 +20,31 @@ import static org.scientificcms.publications.SciPublicationsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "WORKING_PAPER_ITEMS", schema = DB_SCHEMA)
|
@Table(name = "WORKING_PAPER_ITEMS", schema = DB_SCHEMA)
|
||||||
@Audited
|
@Audited
|
||||||
public class WorkingPaperItem
|
public class WorkingPaperItem extends PublicationItem<WorkingPaper> {
|
||||||
extends AbstractPublicationItem<WorkingPaper> {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@OneToOne(cascade = {CascadeType.DETACH,
|
// @OneToOne(cascade = {CascadeType.DETACH,
|
||||||
CascadeType.MERGE,
|
// CascadeType.MERGE,
|
||||||
CascadeType.PERSIST,
|
// CascadeType.PERSIST,
|
||||||
CascadeType.REFRESH
|
// CascadeType.REFRESH
|
||||||
})
|
// })
|
||||||
@JoinColumn(name = "EXPERTISE_ID")
|
// @JoinColumn(name = "EXPERTISE_ID")
|
||||||
private WorkingPaper workingPaper;
|
// private WorkingPaper workingPaper;
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public WorkingPaper getPublication() {
|
// public WorkingPaper getPublication() {
|
||||||
return workingPaper;
|
// return workingPaper;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected void setPublication(final WorkingPaper workingPaper) {
|
// protected void setPublication(final WorkingPaper workingPaper) {
|
||||||
this.workingPaper = workingPaper;
|
// this.workingPaper = workingPaper;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = super.hashCode();
|
int hash = super.hashCode();
|
||||||
hash = 67 * hash + Objects.hashCode(workingPaper);
|
// hash = 67 * hash + Objects.hashCode(workingPaper);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,10 +64,11 @@ public class WorkingPaperItem
|
||||||
}
|
}
|
||||||
final WorkingPaperItem other
|
final WorkingPaperItem other
|
||||||
= (WorkingPaperItem) obj;
|
= (WorkingPaperItem) obj;
|
||||||
if (!other.canEqual(this)) {
|
// if (!other.canEqual(this)) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return Objects.equals(this.workingPaper, other.getPublication());
|
// return Objects.equals(this.workingPaper, other.getPublication());
|
||||||
|
return other.canEqual(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -82,11 +76,11 @@ public class WorkingPaperItem
|
||||||
return obj instanceof WorkingPaperItem;
|
return obj instanceof WorkingPaperItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public String toString(final String data) {
|
// public String toString(final String data) {
|
||||||
return super.toString(String.format(", workingPaper = %s%s",
|
// return super.toString(String.format(", workingPaper = %s%s",
|
||||||
Objects.toString(workingPaper),
|
// Objects.toString(workingPaper),
|
||||||
data));
|
// data));
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue