Commit c45cafa7 authored by Stefan Oppl's avatar Stefan Oppl
Browse files

extended data model (question management)

parent ab17e508
Pipeline #918 passed with stages
in 10 minutes and 47 seconds
{
"name": "Antwort",
"fields": [
{
"fieldName": "antworttext",
"fieldType": "String"
},
{
"fieldName": "richtigeAntwort",
"fieldType": "Boolean"
}
],
"relationships": [
{
"relationshipType": "many-to-one",
"otherEntityName": "frage",
"otherEntityRelationshipName": "antwort",
"relationshipName": "frage",
"otherEntityField": "id"
}
],
"changelogDate": "20190801052101",
"entityTableName": "antwort",
"dto": "no",
"pagination": "no",
"service": "serviceImpl",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}
\ No newline at end of file
{
"name": "Frage",
"fields": [
{
"fieldName": "formulierung",
"fieldType": "String"
},
{
"fieldName": "fragenummer",
"fieldType": "Integer"
},
{
"fieldName": "beschreibung",
"fieldType": "String"
},
{
"fieldName": "erstelldatum",
"fieldType": "LocalDate"
},
{
"fieldName": "bild",
"fieldType": "byte[]",
"fieldTypeBlobContent": "any"
},
{
"fieldName": "status",
"fieldType": "Status",
"fieldValues": "Draft,Created,ToBeRevised,Approved,Final,Obsolete"
},
{
"fieldName": "parentID",
"fieldType": "Integer"
},
{
"fieldName": "currVersionFlag",
"fieldType": "Boolean"
}
],
"relationships": [
{
"relationshipType": "one-to-many",
"otherEntityName": "antwort",
"otherEntityRelationshipName": "frage",
"relationshipName": "antwort"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "user",
"otherEntityRelationshipName": "frage",
"relationshipName": "autor",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "user",
"otherEntityRelationshipName": "frage",
"relationshipName": "bearbeiter",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-many",
"otherEntityName": "schlagwort",
"otherEntityRelationshipName": "frage",
"relationshipName": "schlagwort",
"otherEntityField": "id",
"ownerSide": true
},
{
"relationshipType": "many-to-one",
"otherEntityName": "modul",
"otherEntityRelationshipName": "frage",
"relationshipName": "modul",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "kategorie",
"otherEntityRelationshipName": "frage",
"relationshipName": "kategorie",
"otherEntityField": "id"
}
],
"changelogDate": "20190801052100",
"entityTableName": "frage",
"dto": "no",
"pagination": "no",
"service": "serviceImpl",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}
\ No newline at end of file
{
"name": "Kategorie",
"fields": [
{
"fieldName": "beschreibung",
"fieldType": "String"
}
],
"relationships": [
{
"relationshipType": "one-to-many",
"otherEntityName": "frage",
"otherEntityRelationshipName": "kategorie",
"relationshipName": "frage"
}
],
"changelogDate": "20190801052104",
"entityTableName": "kategorie",
"dto": "no",
"pagination": "no",
"service": "serviceImpl",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}
\ No newline at end of file
{
"name": "Kommentar",
"fields": [
{
"fieldName": "kommentartext",
"fieldType": "String"
},
{
"fieldName": "bearbeitungsdatum",
"fieldType": "LocalDate"
}
],
"relationships": [
{
"relationshipType": "many-to-one",
"otherEntityName": "frage",
"otherEntityRelationshipName": "kommentar",
"relationshipName": "frage",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "user",
"otherEntityRelationshipName": "kommentar",
"relationshipName": "kommentator",
"otherEntityField": "id"
}
],
"changelogDate": "20190801052103",
"entityTableName": "kommentar",
"dto": "no",
"pagination": "no",
"service": "serviceImpl",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}
\ No newline at end of file
......@@ -23,6 +23,14 @@
"relationshipName": "termin",
"otherEntityField": "id",
"ownerSide": false
},
{
"relationshipType": "many-to-many",
"otherEntityName": "teacher",
"otherEntityRelationshipName": "lvaInstanzID",
"relationshipName": "leiter",
"otherEntityField": "id",
"ownerSide": false
}
],
"changelogDate": "20190520065436",
......
......@@ -24,12 +24,10 @@
],
"relationships": [
{
"relationshipType": "one-to-one",
"otherEntityName": "user",
"relationshipType": "one-to-many",
"otherEntityName": "frage",
"otherEntityRelationshipName": "modul",
"relationshipName": "mover",
"otherEntityField": "id",
"ownerSide": true
"relationshipName": "frage"
},
{
"relationshipType": "many-to-one",
......@@ -37,6 +35,14 @@
"otherEntityRelationshipName": "modul",
"relationshipName": "pruefung",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-many",
"otherEntityName": "mover",
"otherEntityRelationshipName": "modulID",
"relationshipName": "mover",
"otherEntityField": "id",
"ownerSide": false
}
],
"changelogDate": "20190327073247",
......
{
"name": "Mover",
"fields": [],
"relationships": [
{
"relationshipType": "one-to-one",
"otherEntityName": "user",
"otherEntityRelationshipName": "mover",
"relationshipName": "user",
"otherEntityField": "id",
"ownerSide": true
},
{
"relationshipType": "many-to-many",
"otherEntityName": "modul",
"otherEntityRelationshipName": "mover",
"relationshipName": "modulID",
"otherEntityField": "id",
"ownerSide": true
}
],
"changelogDate": "20190801052057",
"entityTableName": "mover",
"dto": "no",
"pagination": "no",
"service": "serviceImpl",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}
\ No newline at end of file
{
"name": "Schlagwort",
"fields": [
{
"fieldName": "wort",
"fieldType": "String"
}
],
"relationships": [
{
"relationshipType": "many-to-many",
"otherEntityName": "frage",
"otherEntityRelationshipName": "schlagwort",
"relationshipName": "frage",
"otherEntityField": "id",
"ownerSide": false
}
],
"changelogDate": "20190801052102",
"entityTableName": "schlagwort",
"dto": "no",
"pagination": "no",
"service": "serviceImpl",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}
\ No newline at end of file
{
"name": "Teacher",
"fields": [],
"relationships": [
{
"relationshipType": "one-to-one",
"otherEntityName": "user",
"otherEntityRelationshipName": "teacher",
"relationshipName": "user",
"otherEntityField": "id",
"ownerSide": true
},
{
"relationshipType": "many-to-many",
"otherEntityName": "lVAInstanz",
"otherEntityRelationshipName": "leiter",
"relationshipName": "lvaInstanzID",
"otherEntityField": "id",
"ownerSide": true
}
],
"changelogDate": "20190801052056",
"entityTableName": "teacher",
"dto": "no",
"pagination": "no",
"service": "serviceImpl",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"clientRootFolder": "",
"applications": "*"
}
\ No newline at end of file
......@@ -53,6 +53,22 @@ public class CacheConfiguration {
cm.createCache(at.jku.ce.zml.domain.Studienjahr.class.getName(), jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.LVAInstanz.class.getName(), jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.LVAInstanz.class.getName() + ".termins", jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Modul.class.getName() + ".frages", jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Modul.class.getName() + ".movers", jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.LVAInstanz.class.getName() + ".leiters", jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Teacher.class.getName(), jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Teacher.class.getName() + ".lvaInstanzIDS", jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Mover.class.getName(), jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Mover.class.getName() + ".modulIDS", jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Frage.class.getName(), jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Frage.class.getName() + ".antworts", jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Frage.class.getName() + ".schlagworts", jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Antwort.class.getName(), jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Schlagwort.class.getName(), jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Schlagwort.class.getName() + ".frages", jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Kommentar.class.getName(), jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Kategorie.class.getName(), jcacheConfiguration);
cm.createCache(at.jku.ce.zml.domain.Kategorie.class.getName() + ".frages", jcacheConfiguration);
// jhipster-needle-ehcache-add-entry
};
}
......
package at.jku.ce.zml.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;
/**
* A Antwort.
*/
@Entity
@Table(name = "antwort")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Antwort implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "antworttext")
private String antworttext;
@Column(name = "richtige_antwort")
private Boolean richtigeAntwort;
@ManyToOne
@JsonIgnoreProperties("antworts")
private Frage frage;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getAntworttext() {
return antworttext;
}
public Antwort antworttext(String antworttext) {
this.antworttext = antworttext;
return this;
}
public void setAntworttext(String antworttext) {
this.antworttext = antworttext;
}
public Boolean isRichtigeAntwort() {
return richtigeAntwort;
}
public Antwort richtigeAntwort(Boolean richtigeAntwort) {
this.richtigeAntwort = richtigeAntwort;
return this;
}
public void setRichtigeAntwort(Boolean richtigeAntwort) {
this.richtigeAntwort = richtigeAntwort;
}
public Frage getFrage() {
return frage;
}
public Antwort frage(Frage frage) {
this.frage = frage;
return this;
}
public void setFrage(Frage frage) {
this.frage = frage;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Antwort antwort = (Antwort) o;
if (antwort.getId() == null || getId() == null) {
return false;
}
return Objects.equals(getId(), antwort.getId());
}
@Override
public int hashCode() {
return Objects.hashCode(getId());
}
@Override
public String toString() {
return "Antwort{" +
"id=" + getId() +
", antworttext='" + getAntworttext() + "'" +
", richtigeAntwort='" + isRichtigeAntwort() + "'" +
"}";
}
}
package at.jku.ce.zml.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;
import at.jku.ce.zml.domain.enumeration.Status;
/**
* A Frage.
*/
@Entity
@Table(name = "frage")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Frage implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "formulierung")
private String formulierung;
@Column(name = "fragenummer")
private Integer fragenummer;
@Column(name = "beschreibung")
private String beschreibung;
@Column(name = "erstelldatum")
private LocalDate erstelldatum;
@Lob
@Column(name = "bild")
private byte[] bild;
@Column(name = "bild_content_type")
private String bildContentType;
@Enumerated(EnumType.STRING)
@Column(name = "status")
private Status status;
@Column(name = "parent_id")
private Integer parentID;
@Column(name = "curr_version_flag")
private Boolean currVersionFlag;
@OneToMany(mappedBy = "frage")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<Antwort> antworts = new HashSet<>();
@ManyToOne
@JsonIgnoreProperties("frages")
private User autor;
@ManyToOne
@JsonIgnoreProperties("frages")
private User bearbeiter;
@ManyToMany
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@JoinTable(name = "frage_schlagwort",
joinColumns = @JoinColumn(name = "frage_id", referencedColumnName = "id"),
inverseJoinColumns = @JoinColumn(name = "schlagwort_id", referencedColumnName = "id"))
private Set<Schlagwort> schlagworts = new HashSet<>();
@ManyToOne
@JsonIgnoreProperties("frages")
private Modul modul;
@ManyToOne
@JsonIgnoreProperties("frages")
private Kategorie kategorie;
// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFormulierung() {
return formulierung;
}
public Frage formulierung(String formulierung) {
this.formulierung = formulierung;
return this;
}
public void setFormulierung(String formulierung) {
this.formulierung = formulierung;
}
public Integer getFragenummer() {
return fragenummer;
}
public Frage fragenummer(Integer fragenummer) {
this.fragenummer = fragenummer;
return this;
}
public void setFragenummer(Integer fragenummer) {
this.fragenummer = fragenummer;
}
public String getBeschreibung() {
return beschreibung;
}
public Frage beschreibung(String beschreibung) {
this.beschreibung = beschreibung;