BasicEntity

This commit is contained in:
uPagge 2021-01-14 21:58:17 +03:00
parent 073bb0e3d9
commit 6235d03420
No known key found for this signature in database
GPG Key ID: 964B40928E4C9088
9 changed files with 59 additions and 122 deletions

View File

@ -18,21 +18,14 @@ import javax.persistence.Id;
//@Entity
//@Table(name = "chat")
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class Chat extends BasicEntity<String> {
public class Chat implements BasicEntity<String> {
@Id
@Column(name = "key")
@EqualsAndHashCode.Include
private String id;
@Column(name = "telegram_id")
private Long telegramId;
@Override
@Id
@Column(name = "key")
@EqualsAndHashCode.Include
public String getId() {
return super.getId();
}
@Override
public void setId(String id) {
super.setId(id);
}
}

View File

@ -18,8 +18,13 @@ import java.util.Set;
@Setter
//@Entity
//@Table(name = "comment")
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)
public class Comment extends BasicEntity<Long> {
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class Comment implements BasicEntity<Long> {
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
private Long id;
@Column(name = "url_api")
private String urlApi;
@ -53,16 +58,4 @@ public class Comment extends BasicEntity<Long> {
@Column(name = "child_id")
private Set<Long> answers;
@Override
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
public Long getId() {
return super.getId();
}
@Override
public void setId(Long id) {
super.setId(id);
}
}

View File

@ -19,7 +19,12 @@ import java.time.LocalDateTime;
//@Entity
//@Table(name = "setting_notify")
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class NotifySetting extends BasicEntity<String> {
public class NotifySetting implements BasicEntity<String> {
@Id
@Column(name = "login")
@EqualsAndHashCode.Include
private String id;
/**
* Дата, после которой пользователю будут поступать уведомления.
@ -27,16 +32,4 @@ public class NotifySetting extends BasicEntity<String> {
@Column(name = "start_receiving")
private LocalDateTime startReceiving;
@Override
@Id
@Column(name = "login")
@EqualsAndHashCode.Include
public String getId() {
return super.getId();
}
@Override
public void setId(String id) {
super.setId(id);
}
}

View File

@ -20,8 +20,12 @@ import java.time.LocalDateTime;
@Setter
@Entity
@Table(name = "project")
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)
public class Project extends BasicEntity<Long> {
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class Project implements BasicEntity<Long> {
@Id
@Column(name = "id")
private Long id;
@Column(name = "name")
private String name;
@ -35,15 +39,4 @@ public class Project extends BasicEntity<Long> {
@Column(name = "creator_id")
private Integer creatorId;
@Id
@Column(name = "id")
@Override
public Long getId() {
return super.getId();
}
@Override
public void setId(Long id) {
super.setId(id);
}
}

View File

@ -28,8 +28,14 @@ import java.util.List;
@Setter
//@Entity
//@Table(name = "pull_request")
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)
public class PullRequest extends BasicEntity<Long> {
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class PullRequest implements BasicEntity<Long> {
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* Идентификатор на стороне битбакета
@ -130,17 +136,4 @@ public class PullRequest extends BasicEntity<Long> {
this.reviewers = reviewers;
}
@Id
@Override
@Column(name = "id")
@EqualsAndHashCode.Include
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return super.getId();
}
@Override
public void setId(Long id) {
super.setId(id);
}
}

View File

@ -22,8 +22,13 @@ import java.util.Set;
@Getter
@Setter
//@Table(name = "task")
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)
public class Task extends BasicEntity<Long> {
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class Task implements BasicEntity<Long> {
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
private Long id;
/**
* Описание задачи
@ -64,16 +69,4 @@ public class Task extends BasicEntity<Long> {
@Column(name = "comment_id")
private Set<Long> answers = new HashSet<>();
@Override
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
public Long getId() {
return super.getId();
}
@Override
public void setId(Long id) {
super.setId(id);
}
}

View File

@ -24,7 +24,12 @@ import javax.persistence.Table;
@Entity
@Table(name = "teamcity_build")
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class BuildShort extends BasicEntity<Long> {
public class BuildShort implements BasicEntity<Long> {
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
private Long id;
@Column(name = "project_id")
private String projectId;
@ -52,16 +57,4 @@ public class BuildShort extends BasicEntity<Long> {
@Column(name = "url")
private String url;
@Override
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
public Long getId() {
return super.getId();
}
@Override
public void setId(Long id) {
super.setId(id);
}
}

View File

@ -20,7 +20,12 @@ import javax.persistence.Table;
@Entity
@Table(name = "teamcity_project")
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class TeamcityProject extends BasicEntity<String> {
public class TeamcityProject implements BasicEntity<String> {
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
private String id;
@Column(name = "name")
private String name;
@ -31,16 +36,4 @@ public class TeamcityProject extends BasicEntity<String> {
@Column(name = "url")
private String url;
@Override
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
public String getId() {
return super.getId();
}
@Override
public void setId(String id) {
super.setId(id);
}
}

View File

@ -25,7 +25,13 @@ import javax.persistence.Table;
@Entity
@Table(name = "teamcity_setting")
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class TeamcitySetting extends BasicEntity<Long> {
public class TeamcitySetting implements BasicEntity<Long> {
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "recipient_id")
private String recipientId;
@ -46,17 +52,4 @@ public class TeamcitySetting extends BasicEntity<Long> {
@Column(name = "failure")
private boolean failure;
@Override
@Id
@Column(name = "id")
@EqualsAndHashCode.Include
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long getId() {
return super.getId();
}
@Override
public void setId(Long id) {
super.setId(id);
}
}