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
|
||||
public class Collection{
|
||||
public class Collect {
|
||||
@Id
|
||||
@GeneratedValue(strategy= GenerationType.AUTO)
|
||||
private final long isbn
|
||||
private final long isbn = 0;
|
||||
@Column(name = "articles")
|
||||
private ArrayList<Article> articles
|
||||
private ArrayList<Article> articles;
|
||||
@Column(name = "name")
|
||||
private String name
|
||||
private String name;
|
||||
@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.teacher = teacher;
|
||||
this.articles = new ArrayList<Article>();
|
||||
}
|
||||
|
||||
public Collect() {
|
||||
}
|
||||
|
||||
// region Article
|
||||
public long getId(){
|
||||
return isbn;
|
@ -1,20 +1,21 @@
|
||||
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;
|
||||
|
||||
public interface ICollectionService{
|
||||
public List<Collection> getAllCollections();
|
||||
public Collection getCollectionById(long isbn);
|
||||
public List<Collection> getAllCollectionsByName(String name);
|
||||
public List<Collect> getAllCollections();
|
||||
public Collect getCollectionById(long isbn);
|
||||
public List<Collect> getAllCollectionsByName(String name);
|
||||
public void deleteColletionById(long isbn);
|
||||
public void deleteColletionByName(String name);
|
||||
public void deleteAllColletionByName(String name);
|
||||
public void addCollection(Collection collection);
|
||||
public void addCollections(List<Collection> collection);
|
||||
public void modifyCollectionName(Collection collection, String name);
|
||||
public void addCollection(Collect collection);
|
||||
public void addCollections(List<Collect> collection);
|
||||
public void modifyCollectionName(Collect collection, String name);
|
||||
public void modifyCollectionNameById(long isbn, String name);
|
||||
public List<Article> getAllArticles(Collection collection);
|
||||
public void addArticle(Collection collection, Article article);
|
||||
public void deleteArticle(Collection collection, Article article);
|
||||
public List<Article> getAllArticles(Collect collection);
|
||||
public void addArticle(Collect collection, Article article);
|
||||
public void deleteArticle(Collect collection, Article article);
|
||||
}
|
Loading…
Reference in new issue