parent
2ffbeaa359
commit
29abf4d5c9
@ -1,22 +1,30 @@
|
|||||||
package SAE.ApiREST.WebService.Data;
|
package SAE.ApiREST.WebService.model;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class Collection{
|
public class Collect {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
@GeneratedValue(strategy= GenerationType.AUTO)
|
||||||
private final long isbn
|
private final long isbn = 0;
|
||||||
@Column(name = "articles")
|
@Column(name = "articles")
|
||||||
private ArrayList<Article> articles
|
private ArrayList<Article> articles;
|
||||||
@Column(name = "name")
|
@Column(name = "name")
|
||||||
private String name
|
private String name;
|
||||||
@Column(name = "teacher")
|
@Column(name = "teacher")
|
||||||
private Teacher teacher
|
private Teacher teacher;
|
||||||
|
|
||||||
public Collection(String name, Teacher teacher){
|
public Collect(String name, Teacher teacher){
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.teacher = teacher;
|
this.teacher = teacher;
|
||||||
this.articles = new ArrayList<Article>();
|
this.articles = new ArrayList<Article>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Collect() {
|
||||||
|
}
|
||||||
|
|
||||||
// region Article
|
// region Article
|
||||||
public long getId(){
|
public long getId(){
|
||||||
return isbn;
|
return isbn;
|
@ -1,20 +1,21 @@
|
|||||||
package SAE.ApiREST.WebService.service;
|
package SAE.ApiREST.WebService.service;
|
||||||
|
import SAE.ApiREST.WebService.model.Collect;
|
||||||
|
import SAE.ApiREST.WebService.model.Article;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ICollectionService{
|
public interface ICollectionService{
|
||||||
public List<Collection> getAllCollections();
|
public List<Collect> getAllCollections();
|
||||||
public Collection getCollectionById(long isbn);
|
public Collect getCollectionById(long isbn);
|
||||||
public List<Collection> getAllCollectionsByName(String name);
|
public List<Collect> getAllCollectionsByName(String name);
|
||||||
public void deleteColletionById(long isbn);
|
public void deleteColletionById(long isbn);
|
||||||
public void deleteColletionByName(String name);
|
public void deleteColletionByName(String name);
|
||||||
public void deleteAllColletionByName(String name);
|
public void deleteAllColletionByName(String name);
|
||||||
public void addCollection(Collection collection);
|
public void addCollection(Collect collection);
|
||||||
public void addCollections(List<Collection> collection);
|
public void addCollections(List<Collect> collection);
|
||||||
public void modifyCollectionName(Collection collection, String name);
|
public void modifyCollectionName(Collect collection, String name);
|
||||||
public void modifyCollectionNameById(long isbn, String name);
|
public void modifyCollectionNameById(long isbn, String name);
|
||||||
public List<Article> getAllArticles(Collection collection);
|
public List<Article> getAllArticles(Collect collection);
|
||||||
public void addArticle(Collection collection, Article article);
|
public void addArticle(Collect collection, Article article);
|
||||||
public void deleteArticle(Collection collection, Article article);
|
public void deleteArticle(Collect collection, Article article);
|
||||||
}
|
}
|
Loading…
Reference in new issue