Repositories for Publications

pull/1/head
Jens Pelzetter 2019-09-07 18:03:39 +02:00
parent 749aa02249
commit d9c8c10ac5
17 changed files with 385 additions and 1 deletions

View File

@ -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 org.scientificcms.publications;
import org.libreccm.core.AbstractEntityRepository;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
* @param <T>
*/
public abstract class AbstractPublicationRepository<T extends Publication>
extends AbstractEntityRepository<Long, T> {
private static final long serialVersionUID = 1L;
@Override
public String getIdAttributeName() {
return "publicationId";
}
@Override
public Long getIdOfEntity(final T entity) {
return entity.getPublicationId();
}
@Override
public boolean isNew(final T entity) {
return entity.getPublicationId() == 0;
}
}

View File

@ -0,0 +1,18 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
* @param <T>
*/
public abstract class AbstractPublicationWithPublisherRepository<T extends PublicationWithPublisher>
extends AbstractPublicationRepository<T> {
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,17 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
* @param <T>
*/
public abstract class AbstractUnPublishedRepository<T extends UnPublished> extends AbstractPublicationRepository<T> {
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,22 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class ArticleInCollectedVolumeRepository
extends AbstractPublicationRepository<ArticleInCollectedVolume> {
private static final long serialVersionUID = 1L;
@Override
public Class<ArticleInCollectedVolume> getEntityClass() {
return ArticleInCollectedVolume.class;
}
}

View File

@ -0,0 +1,22 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class ArticleInJournalRepository
extends AbstractPublicationRepository<ArticleInJournal>{
private static final long serialVersionUID = 1L;
@Override
public Class<ArticleInJournal> getEntityClass() {
return ArticleInJournal.class;
}
}

View File

@ -0,0 +1,22 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class CollectedVolumeRepository
extends AbstractPublicationWithPublisherRepository<CollectedVolume>{
private static final long serialVersionUID = 1L;
@Override
public Class<CollectedVolume> getEntityClass() {
return CollectedVolume.class;
}
}

View File

@ -0,0 +1,21 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class ExpertiseRepository extends AbstractPublicationRepository<Expertise> {
private static final long serialVersionUID = 1L;
@Override
public Class<Expertise> getEntityClass() {
return Expertise.class;
}
}

View File

@ -0,0 +1,22 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class GreyLiteratureRepository
extends AbstractUnPublishedRepository<GreyLiterature>{
private static final long serialVersionUID = 1L;
@Override
public Class<GreyLiterature> getEntityClass() {
return GreyLiterature.class;
}
}

View File

@ -0,0 +1,21 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class InProceedingsRepository extends AbstractPublicationRepository<InProceedings> {
private static final long serialVersionUID = 1L;
@Override
public Class<InProceedings> getEntityClass() {
return InProceedings.class;
}
}

View File

@ -0,0 +1,21 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class InternetArticleRepository extends AbstractPublicationRepository<InternetArticle>{
private static final long serialVersionUID = 1L;
@Override
public Class<InternetArticle> getEntityClass() {
return InternetArticle.class;
}
}

View File

@ -0,0 +1,38 @@
/*
* 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;
import org.libreccm.core.AbstractEntityRepository;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class JournalRepository extends AbstractEntityRepository<Long, Journal>{
private static final long serialVersionUID = 1L;
@Override
public Class<Journal> getEntityClass() {
return Journal.class;
}
@Override
public String getIdAttributeName() {
return "journalId";
}
@Override
public Long getIdOfEntity(final Journal entity) {
return entity.getJournalId();
}
@Override
public boolean isNew(final Journal entity) {
return entity.getJournalId() == 0;
}
}

View File

@ -0,0 +1,22 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class MonographRepository
extends AbstractPublicationWithPublisherRepository<Monograph> {
private static final long serialVersionUID = 1L;
@Override
public Class<Monograph> getEntityClass() {
return Monograph.class;
}
}

View File

@ -0,0 +1,22 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class ProceedingsRepository
extends AbstractPublicationWithPublisherRepository<Proceedings>{
private static final long serialVersionUID = 1L;
@Override
public Class<Proceedings> getEntityClass() {
return Proceedings.class;
}
}

View File

@ -65,7 +65,7 @@ public class PublicationWithPublisher extends Publication {
return publisher; return publisher;
} }
public void setPublisher(final Publisher publisher) { protected void setPublisher(final Publisher publisher) {
this.publisher = publisher; this.publisher = publisher;
} }

View File

@ -0,0 +1,39 @@
/*
* 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;
import org.libreccm.core.AbstractEntityRepository;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class PublisherRepository
extends AbstractEntityRepository<Long, Publisher>{
private static final long serialVersionUID = 1L;
@Override
public Class<Publisher> getEntityClass() {
return Publisher.class;
}
@Override
public String getIdAttributeName() {
return "publisherId";
}
@Override
public Long getIdOfEntity(final Publisher entity) {
return entity.getPublisherId();
}
@Override
public boolean isNew(final Publisher entity) {
return entity.getPublisherId() == 0;
}
}

View File

@ -0,0 +1,21 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class TalkRepository extends AbstractPublicationRepository<Talk> {
private static final long serialVersionUID = 1L;
@Override
public Class<Talk> getEntityClass() {
return Talk.class;
}
}

View File

@ -0,0 +1,21 @@
/*
* 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;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class WorkingPaperRepository extends AbstractUnPublishedRepository<WorkingPaper> {
private static final long serialVersionUID = 1L;
@Override
public Class<WorkingPaper> getEntityClass() {
return WorkingPaper.class;
}
}