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

Merge branch 'create-project' into 'development'

Draft: Create project Entity

Closes #266

See merge request !417
parents 8f5de6e4 cdf3b993
No related branches found
No related tags found
No related merge requests found
Pipeline #1232523 failed
......@@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Added JobHolder and Project Entity @mmadara
### Changed
### Fixed
......
......
/*
* 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 java.util.HashSet;
import java.util.Set;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@Data
@Entity
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Inheritance(strategy = InheritanceType.JOINED)
public class JobHolder {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY) //TODO: Once suborganisation is implemented, change to move this annotation to SubOrganisation id
private Long id;
@OneToMany(mappedBy = "holder")
private Set<JobOffer> jobOffers = new HashSet<>();
}
......@@ -43,7 +43,11 @@ public class JobOffer {
private Long id;
@NotNull
private Long editionId;
private Long editionId; //TODO: Remove this field
@Nullable
@ManyToOne
private JobHolder holder;
@NotBlank
@Builder.Default
......
......
/*
* 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 javax.validation.constraints.NotNull;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
// TODO: once suborganisation is implemented, change JobHolder to SubOrganisation
@Data
@Entity
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class Project extends JobHolder {
@NotNull
private String name;
@NotNull
@ManyToOne
private TAMProgram organisation; //TODO: once Organisation is implemented, change TAMProgram to Organisation
}
/*
* 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 {
}
......@@ -938,3 +938,146 @@ databaseChangeLog:
oldColumnName: hidden
columnDataType: bit
tableName: job_offer
## 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