added extention entities
This commit is contained in:
		@ -4,5 +4,7 @@ public enum FileType {
 | 
			
		||||
 | 
			
		||||
    ProfilePicture,
 | 
			
		||||
 | 
			
		||||
    EducationCertificate
 | 
			
		||||
    EducationCertificate,
 | 
			
		||||
 | 
			
		||||
    Article,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
package ovh.herisson.Clyde.Tables.ScientificPublications;
 | 
			
		||||
 | 
			
		||||
public enum Access {
 | 
			
		||||
    OpenSource,
 | 
			
		||||
    Restricted,
 | 
			
		||||
    Private,
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,51 @@
 | 
			
		||||
package ovh.herisson.Clyde.Tables.ScientificPublications;
 | 
			
		||||
 | 
			
		||||
import jakarta.persistence.*;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Getter;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.Setter;
 | 
			
		||||
import org.hibernate.annotations.CreationTimestamp;
 | 
			
		||||
import org.hibernate.annotations.OnDelete;
 | 
			
		||||
import org.hibernate.annotations.OnDeleteAction;
 | 
			
		||||
import ovh.herisson.Clyde.Tables.User;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
@Getter
 | 
			
		||||
@Setter
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
@Entity
 | 
			
		||||
public class Article {
 | 
			
		||||
    @Id
 | 
			
		||||
    @GeneratedValue(strategy = GenerationType.AUTO)
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    private String title;
 | 
			
		||||
 | 
			
		||||
    @ManyToOne(fetch = FetchType.EAGER)
 | 
			
		||||
    @OnDelete(action = OnDeleteAction.CASCADE)
 | 
			
		||||
    @JoinColumn(name ="Users")
 | 
			
		||||
    private User author;
 | 
			
		||||
 | 
			
		||||
    //todo change user to Researcher
 | 
			
		||||
    @CreationTimestamp
 | 
			
		||||
    @Column(nullable = false)
 | 
			
		||||
    private Date releaseDate;
 | 
			
		||||
 | 
			
		||||
    private PublishType publishType;
 | 
			
		||||
 | 
			
		||||
    private String pdfLocation;
 | 
			
		||||
 | 
			
		||||
    private String bibTexLocation;
 | 
			
		||||
 | 
			
		||||
    private String language;
 | 
			
		||||
 | 
			
		||||
    private Access access;
 | 
			
		||||
 | 
			
		||||
    private String domain;
 | 
			
		||||
 | 
			
		||||
    private String summary;
 | 
			
		||||
 | 
			
		||||
    private int views;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,27 @@
 | 
			
		||||
package ovh.herisson.Clyde.Tables.ScientificPublications;
 | 
			
		||||
 | 
			
		||||
import jakarta.persistence.FetchType;
 | 
			
		||||
import jakarta.persistence.JoinColumn;
 | 
			
		||||
import jakarta.persistence.ManyToOne;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Getter;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.Setter;
 | 
			
		||||
import org.hibernate.annotations.OnDelete;
 | 
			
		||||
import org.hibernate.annotations.OnDeleteAction;
 | 
			
		||||
 | 
			
		||||
@Getter
 | 
			
		||||
@Setter
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class ArticleCoAuthors {
 | 
			
		||||
 | 
			
		||||
    @ManyToOne(fetch = FetchType.EAGER)
 | 
			
		||||
    @JoinColumn(name = "Researcher")
 | 
			
		||||
    private Researcher coAuthor;
 | 
			
		||||
 | 
			
		||||
    @ManyToOne(fetch = FetchType.EAGER)
 | 
			
		||||
    @OnDelete(action = OnDeleteAction.CASCADE)
 | 
			
		||||
    @JoinColumn(name = "Article")
 | 
			
		||||
    private Article article;
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,6 @@
 | 
			
		||||
package ovh.herisson.Clyde.Tables.ScientificPublications;
 | 
			
		||||
 | 
			
		||||
public enum PublishType {
 | 
			
		||||
    article,
 | 
			
		||||
    slides,
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,25 @@
 | 
			
		||||
package ovh.herisson.Clyde.Tables.ScientificPublications;
 | 
			
		||||
 | 
			
		||||
import jakarta.persistence.*;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Getter;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.Setter;
 | 
			
		||||
import ovh.herisson.Clyde.Tables.User;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@Getter
 | 
			
		||||
@Setter
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
@Entity
 | 
			
		||||
public class Researcher {
 | 
			
		||||
    @Id
 | 
			
		||||
    @GeneratedValue(strategy = GenerationType.AUTO)
 | 
			
		||||
    private long id;
 | 
			
		||||
    @OneToOne
 | 
			
		||||
    private User user;
 | 
			
		||||
    private String orcidId;
 | 
			
		||||
    private String site;
 | 
			
		||||
    private String Domain;
 | 
			
		||||
}
 | 
			
		||||
@ -28,11 +28,11 @@ public class User {
 | 
			
		||||
	////// Extension Messagerie /////
 | 
			
		||||
	@OneToMany(mappedBy = "author", cascade = CascadeType.ALL)
 | 
			
		||||
	private List<Message> msgs;
 | 
			
		||||
	/////////////////////////////////
 | 
			
		||||
 | 
			
		||||
	@ManyToMany( mappedBy = "members" )
 | 
			
		||||
	private List<Discussion> discussions;
 | 
			
		||||
 | 
			
		||||
    /////////////////////////////////
 | 
			
		||||
    public User(String lastName, String firstName, String email, String address,
 | 
			
		||||
                String country, Date birthDate, String profilePictureUrl, Role role, String password)
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user