Skip to content
Snippets Groups Projects
Commit e6b8a17d authored by Marina Mădăraş's avatar Marina Mădăraş
Browse files

Make jobholder abstract

parent cdf3b993
No related branches found
No related tags found
No related merge requests found
Pipeline #1233339 failed
...@@ -8,7 +8,7 @@ version = "2.2.5" ...@@ -8,7 +8,7 @@ version = "2.2.5"
val javaVersion = JavaVersion.VERSION_21 val javaVersion = JavaVersion.VERSION_21
val labradoorVersion = "1.6.14" val labradoorVersion = "1.6.5"
val libradorVersion = "1.4.1" val libradorVersion = "1.4.1"
val chihuahUIVersion = "1.2.2" val chihuahUIVersion = "1.2.2"
val guavaVersion = "32.1.1-jre" val guavaVersion = "32.1.1-jre"
... ...
......
...@@ -31,11 +31,13 @@ import lombok.experimental.SuperBuilder; ...@@ -31,11 +31,13 @@ import lombok.experimental.SuperBuilder;
@SuperBuilder @SuperBuilder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Inheritance(strategy = InheritanceType.JOINED) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class JobHolder { public sealed abstract class JobHolder permits Project {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) //TODO: Once suborganisation is implemented, change to move this annotation to SubOrganisation id public abstract Long getId();
private Long id;
public abstract void setId(Long id);
@OneToMany(mappedBy = "holder") @OneToMany(mappedBy = "holder")
private Set<JobOffer> jobOffers = new HashSet<>(); private Set<JobOffer> jobOffers = new HashSet<>();
... ...
......
...@@ -25,13 +25,20 @@ import lombok.Data; ...@@ -25,13 +25,20 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
// TODO: once suborganisation is implemented, change JobHolder to SubOrganisation /*
* TODO: once suborganisation is implemented, change JobHolder to SubOrganisation and add a one to one
* ProjectJobOffers entity
*/
@Data @Data
@Entity @Entity
@SuperBuilder @SuperBuilder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class Project extends JobHolder { public non-sealed class Project extends JobHolder {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotNull @NotNull
private String name; private String name;
... ...
......
/*
* TAM
* Copyright (C) 2021 - Delft University of Technology
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package nl.tudelft.tam.model;
import jakarta.persistence.Entity;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@Entity
@SuperBuilder
@NoArgsConstructor
//@AllArgsConstructor
public class ProjectJobOffers extends JobHolder {
}
...@@ -940,144 +940,4 @@ databaseChangeLog: ...@@ -940,144 +940,4 @@ databaseChangeLog:
tableName: job_offer tableName: job_offer
## TAM Improvement ## TAM Improvement
- changeSet:
id: 1743251882315-1
author: marina (generated)
changes:
- createTable:
columns:
- column:
autoIncrement: true
constraints:
nullable: false
primaryKey: true
primaryKeyName: CONSTRAINT_8D
name: id
type: BIGINT
tableName: job_holder
- changeSet:
id: 1743251882315-2
author: marina (generated)
changes:
- createTable:
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: CONSTRAINT_ED9
name: id
type: BIGINT
- column:
name: organisation_id
type: BIGINT
- column:
name: name
type: VARCHAR(255)
tableName: project
- changeSet:
id: 1743251882315-3
author: marina (generated)
changes:
- createTable:
columns:
- column:
constraints:
nullable: false
primaryKey: true
primaryKeyName: CONSTRAINT_9
name: id
type: BIGINT
tableName: project_job_offers
- changeSet:
id: 1743251882315-4
author: marina (generated)
changes:
- addColumn:
columns:
- column:
name: holder_id
type: BIGINT
tableName: job_offer
- changeSet:
id: 1743251882315-5
author: marina (generated)
changes:
- createIndex:
associatedWith: ''
columns:
- column:
name: holder_id
indexName: FK37ddvbsl9gj5fxvi77f235buj_INDEX_5
tableName: job_offer
- changeSet:
id: 1743251882315-6
author: marina (generated)
changes:
- createIndex:
associatedWith: ''
columns:
- column:
name: organisation_id
indexName: FK3quouuek44c2lxbp9uh7b4pm1_INDEX_E
tableName: project
- changeSet:
id: 1743251882315-7
author: marina (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: holder_id
baseTableName: job_offer
constraintName: FK37ddvbsl9gj5fxvi77f235buj
deferrable: false
initiallyDeferred: false
onDelete: RESTRICT
onUpdate: RESTRICT
referencedColumnNames: id
referencedTableName: job_holder
validate: true
- changeSet:
id: 1743251882315-8
author: marina (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: organisation_id
baseTableName: project
constraintName: FK3quouuek44c2lxbp9uh7b4pm1
deferrable: false
initiallyDeferred: false
onDelete: RESTRICT
onUpdate: RESTRICT
referencedColumnNames: id
referencedTableName: tamprogram
validate: true
- changeSet:
id: 1743251882315-9
author: marina (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: id
baseTableName: project_job_offers
constraintName: FKlr407g8ab3ipnis7hjb04j39n
deferrable: false
initiallyDeferred: false
onDelete: RESTRICT
onUpdate: RESTRICT
referencedColumnNames: id
referencedTableName: job_holder
validate: true
- changeSet:
id: 1743251882315-10
author: marina (generated)
changes:
- addForeignKeyConstraint:
baseColumnNames: id
baseTableName: project
constraintName: FKnkb4e1xadrghkv5x4vbipkxgr
deferrable: false
initiallyDeferred: false
onDelete: RESTRICT
onUpdate: RESTRICT
referencedColumnNames: id
referencedTableName: job_holder
validate: true
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment