anpassungen lombok
This commit is contained in:
parent
1c8050bdff
commit
1b6b3663ca
BIN
kibu.sqlite
BIN
kibu.sqlite
Binary file not shown.
21
pom.xml
21
pom.xml
@ -62,6 +62,13 @@
|
|||||||
<artifactId>hibernate-community-dialects</artifactId>
|
<artifactId>hibernate-community-dialects</artifactId>
|
||||||
<version>6.6.15.Final</version>
|
<version>6.6.15.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.38</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -70,6 +77,20 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.11.0</version>
|
||||||
|
<configuration>
|
||||||
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.38</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,18 @@
|
|||||||
package de.roko.archiv.kibubackend.model;
|
package de.roko.archiv.kibubackend.model;
|
||||||
|
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.*;
|
||||||
import jakarta.persistence.GeneratedValue;
|
import lombok.*;
|
||||||
import jakarta.persistence.GenerationType;
|
|
||||||
import jakarta.persistence.Id;
|
import java.util.List;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
public class Archiv {
|
public class Archiv {
|
||||||
|
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -17,36 +21,7 @@ public class Archiv {
|
|||||||
|
|
||||||
private String link;
|
private String link;
|
||||||
|
|
||||||
public Archiv() {
|
@OneToMany(mappedBy = "archiv", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||||
|
private List<Kreis> kreise;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Archiv(String name, String link) {
|
|
||||||
this.name = name;
|
|
||||||
this.link = link;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLink() {
|
|
||||||
return link;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLink(String link) {
|
|
||||||
this.link = link;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,10 +1,17 @@
|
|||||||
package de.roko.archiv.kibubackend.model;
|
package de.roko.archiv.kibubackend.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Entity
|
@Entity
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class Bild {
|
public class Bild {
|
||||||
|
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
Long id;
|
Long id;
|
||||||
@ -17,43 +24,4 @@ public class Bild {
|
|||||||
private int tileX;
|
private int tileX;
|
||||||
private int tileY;
|
private int tileY;
|
||||||
|
|
||||||
public int getTileY() {
|
|
||||||
return tileY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTileY(int tileY) {
|
|
||||||
this.tileY = tileY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTileX() {
|
|
||||||
return tileX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTileX(int tileX) {
|
|
||||||
this.tileX = tileX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Seite getSeite() {
|
|
||||||
return seite;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSeite(Seite seite) {
|
|
||||||
this.seite = seite;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDateiname() {
|
|
||||||
return dateiname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDateiname(String dateiname) {
|
|
||||||
this.dateiname = dateiname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,60 +1,34 @@
|
|||||||
package de.roko.archiv.kibubackend.model;
|
package de.roko.archiv.kibubackend.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Entity
|
@Entity
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class Buch {
|
public class Buch {
|
||||||
|
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
private String titel;
|
private String titel;
|
||||||
|
|
||||||
private String link;
|
private String link;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
Ort ort;
|
private Ort ort;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "buch", cascade = CascadeType.ALL)
|
||||||
|
private List<Seite> seiten;
|
||||||
|
|
||||||
private String typ;
|
private String typ;
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTitel() {
|
|
||||||
return titel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTitel(String titel) {
|
|
||||||
this.titel = titel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLink() {
|
|
||||||
return link;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLink(String link) {
|
|
||||||
this.link = link;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Ort getOrt() {
|
|
||||||
return ort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrt(Ort ort) {
|
|
||||||
this.ort = ort;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTyp() {
|
|
||||||
return typ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTyp(String typ) {
|
|
||||||
this.typ = typ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,16 @@
|
|||||||
package de.roko.archiv.kibubackend.model;
|
package de.roko.archiv.kibubackend.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Entity
|
@Entity
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class Kreis {
|
public class Kreis {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@ -11,7 +19,11 @@ public class Kreis {
|
|||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "archiv_id", nullable = false)
|
||||||
Archiv archiv;
|
Archiv archiv;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "kreis", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||||
|
private List<Ort> orte;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,19 @@
|
|||||||
package de.roko.archiv.kibubackend.model;
|
package de.roko.archiv.kibubackend.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Entity
|
@Entity
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class Ort {
|
public class Ort {
|
||||||
|
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -14,27 +23,7 @@ public class Ort {
|
|||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Kreis kreis;
|
private Kreis kreis;
|
||||||
|
|
||||||
public Long getId() {
|
@OneToMany(mappedBy = "ort", cascade = CascadeType.ALL)
|
||||||
return id;
|
private List<Buch> buecher;
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Kreis getKreis() {
|
|
||||||
return kreis;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setKreis(Kreis kreis) {
|
|
||||||
this.kreis = kreis;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,16 @@
|
|||||||
package de.roko.archiv.kibubackend.model;
|
package de.roko.archiv.kibubackend.model;
|
||||||
|
|
||||||
import jakarta.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Entity
|
@Entity
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class Seite {
|
public class Seite {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@ -14,37 +22,9 @@ public class Seite {
|
|||||||
@ManyToOne
|
@ManyToOne
|
||||||
private Buch buch;
|
private Buch buch;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "seite", cascade = CascadeType.ALL)
|
||||||
|
private List<Bild> bilder;
|
||||||
|
|
||||||
private String meta;
|
private String meta;
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSeitenNummer() {
|
|
||||||
return seitenNummer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSeitenNummer(int seitenNummer) {
|
|
||||||
this.seitenNummer = seitenNummer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Buch getBuch() {
|
|
||||||
return buch;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBuch(Buch buch) {
|
|
||||||
this.buch = buch;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMeta() {
|
|
||||||
return meta;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMeta(String meta) {
|
|
||||||
this.meta = meta;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/test/java/de/roko/archiv/kibubackend/LombokTest.java
Normal file
12
src/test/java/de/roko/archiv/kibubackend/LombokTest.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package de.roko.archiv.kibubackend;
|
||||||
|
|
||||||
|
import de.roko.archiv.kibubackend.model.Archiv;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
public class LombokTest {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Archiv archiv = Archiv.builder().name("Test").link("http://example.com").build();
|
||||||
|
archiv.setId(42L);
|
||||||
|
System.out.println("ID: " + archiv.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user