48 lines
1.0 KiB
Java
Executable File
48 lines
1.0 KiB
Java
Executable File
package com.plannaplan.entities;
|
|
|
|
import java.sql.Timestamp;
|
|
import java.util.List;
|
|
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.GenerationType;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.JoinColumn;
|
|
import javax.persistence.OneToMany;
|
|
import javax.persistence.OneToOne;
|
|
|
|
@Entity
|
|
public class Commision {
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
|
private Long id;
|
|
@OneToOne
|
|
@JoinColumn(name = "owner_id")
|
|
private User commisionOwner;
|
|
private Timestamp commisionDate;
|
|
|
|
@OneToMany(mappedBy = "commision")
|
|
private List<Assignment> assignments;
|
|
|
|
public Commision(User user) {
|
|
this.commisionDate = new Timestamp(System.currentTimeMillis());
|
|
this.commisionOwner = user;
|
|
}
|
|
|
|
public Commision() {
|
|
}
|
|
|
|
public Long getId() {
|
|
return this.id;
|
|
}
|
|
|
|
public Timestamp getCommisionDate() {
|
|
return commisionDate;
|
|
}
|
|
|
|
public User getCommisionOwner() {
|
|
return commisionOwner;
|
|
}
|
|
|
|
}
|