Merge branch 'tibor' into 'master'

Tibor

See merge request bossanyit/aitrainer_server!11
This commit is contained in:
Bossányi Tibor 2020-08-19 06:34:47 +00:00
commit 71c6be54bd
7 changed files with 49 additions and 35 deletions

View File

@ -142,34 +142,36 @@ CREATE TABLE `exercise_type` (
`unit_quantity` TINYINT(4) NULL DEFAULT NULL,
`unit_quantity_unit` CHAR(50) NULL DEFAULT NULL COLLATE 'utf8_hungarian_ci',
`active` TINYINT(1) NULL DEFAULT '1',
`active` TINYINT(1) NULL DEFAULT '0',
PRIMARY KEY (`exercise_type_id`) USING BTREE
-- Tábla adatainak mentése aitrainer.exercise_type: ~11 rows (hozzávetőleg)
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (1, 0, 'Melső fekvőtámasz 1 perc', 'Ezt igazolja a 2016 márciusában beállított guinness rekord is,\r\namelyben KJ Joseph 1 perc alatt 82 szabályos karhajlítás-nyújtást\r\nvégzett.', 'repeat', 60, 'second', NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (2, 0, 'Húzódzkodás', 'Ennek a gyakorlatnak a 24 órás csúcstartója Joonas Mäkipelto 5050\r\ngyakorlattal.', 'repeat', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (3, 0, 'Melső fekvőtámasz 30mp', 'A gyakorlatot 30 másodperc alatt olyan sokszor kell végrehajtani, ahányszor a\r\nfelvételiző képes rá. Azonban törekedni kell a szabályos végrehajtásra, ugyanis csak azokat\r\nszámolják. A nők esetében 20, a férfiak esetében 35 gyakorlatot kell végrehajtani a maximális\r\npont megszerzéséért. A gyakorlat akkor sikeres, ha a női legalább 1, a férfi felvételiző\r\nlegalább 11 gyakorlatot képes végrehajtani.', 'repeat', 30, 'second', NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (4, 0, 'Melső fekvőtámasz 2perc', 'Magyar Honvédség: A gyakorlat végrehajtására 2 perc áll rendelkezésre. Ennek során csak a szabályosan a\r\nfentiekben leírt módon végrehajtott gyakorlat értékelhető. Férfiaknál 70 karhajlítás nyújtást\r\nkell végrehajtani a maximális pontért.', 'repeat', 120, 'second', NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (5, 0, 'Hajlított karú függés', 'A gyakorlat addig tart, amíg a végrehajtó szemmagassága a kiinduló helyzettől\r\nsüllyedve a keresztvas alá nem kerül. Az értékeléshez stopperórát alkalmaznak, és az\r\neredmény másodperc pontossággal kerül megállapításra. Nők esetében 45, férfiak\r\ntekintetében 73 másodperctől jár a maximális pontszám. A gyakorlat sikeres végrehajtásához\r\nlegalább 8, 10 másodpercig kell megtartaniuk a kiinduló helyzetet a női és a férfi\r\nfelvételizőknek.\r\n\r\nA NKE-RTK-án lévő hallgatók egyéni rekordjai Iván Viktor 90s, Kiss Regina 74s', 'second', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (6, 0, 'Fekvenyomás', '2015-ben a fekvenyomó világbajnokságot Smulter Fredrik finn súlyemelő 401 Kg-al nyerte.\r\nA súlyzó tömege nők esetében 25 kg, a férfiak esetében 60 kg a rúddal együtt. Az\r\nértékelésénél a szabályosan végrehajtott gyakorlatokat értékelik csak.\r\nA legtöbb pontért 25 gyakorlatot kell végezni mind a nőknek, mind a férfiaknak. A minimum:\r\negy gyakorlat mindkét nem esetében.', 'repeat', NULL, 'kg', NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (7, 0, '4x10m-es ingafutás', 'A legjobb pontszámért 9,4 s illetve 8,8s alatt kell teljesíteni a nőknek, férfiaknak. A\r\ngyakorlat sikertelen 11,8 s illetve 11,2 s-on túl.', 'second', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (8, 0, 'Helyből távolugrás', 'Byron Jones 2015-ben a 3,73 méteres ugrásával érte el a világcsúcsot.\r\nA nőknek 220 cm-re, a férfiak 250 cm-re kell ugraniuk a maximális pontért. A\r\nminimális távolság 172cm illetve 198 cm.', 'meter', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (9, 0, 'Felülés hanyattfekvésből', 'Az NKE-RTK hallgatói közül Papp Zsófia 66 db-ot, Gál Valentin 80\r\ndb-ot csinált 1 perc leforgása alatt.\r\nElső ütemre megtörténik a felülés, ami akkor szabályos, ha valamelyik könyök érinti a\r\ntérdet. Második ütemre vissza kell térni a kiinduló helyzetbe. A maximális pont eléréséhez 1\r\nperc alatt 45 illetve 55 ismétlést kell végezni a nőknek illetve a férfiaknak. A minimumhoz 7\r\nés 25 ismétlés szükséges.', 'repeat', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (10, 0, 'Felülés hajlított térddel', 'Magyar Honvédség: A kiinduló helyzet hajlított ülés, ennek során a sarkak a talajon, a térd 90 fokban meghajlítva\r\nvan.\r\nA gyakorlat végrehajtására két perc áll rendelkezésre. Ennek során csak a szabályosan,\r\na fentiekben leírt módon végrehajtott gyakorlat értékelhető. Férfiaknál, nőknél egyaránt 90\r\ngyakorlatot kell végrehajtani a maximális pontért. Amennyiben a megadott időkeret alatt nem\r\nsikerül legalább 25 szabályos gyakorlatot végrehajtani, úgy az sikertelennek minősül.', 'repeat', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (11, 0, 'Síkfutás 2000m', 'A maximálisan megszerezhető pontot az a felvételiző gyűjtheti be, aki a távot nők\r\nesetében 10:00 perc alatt, férfiak esetében 7:35 perc alatt teljesíti. A gyakorlat sikeres\r\nteljesítésére nők esetében maximum 16:00 perc, férfiak esetében 13:30 perc áll rendelkezésre.', 'second', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (30, 0, 'Cooper', '12 minutes run, how many meters', 'meter', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (31, 0, '300m', NULL, 'second', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (32, 0, '400m', NULL, 'second', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (33, 0, 'Pushups', '', 'repeat', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (34, 0, 'Timed Pushups', NULL, 'repeat', 1, 'second', NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (35, 0, 'Squats', NULL, 'repeat', 1, 'kg', NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (36, 0, 'Sit-ups', NULL, 'repeat', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (37, 0, 'Chest Press', '', 'repeat', 1, 'kg', 1);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (38, 0, 'Pull Ups', NULL, 'repeat', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (39, 0, 'Biceps', '', 'repeat', 1, 'kg', 1);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (40, 4, 'Triceps', 'Triceps', 'repeat', 1, 'kg', 1);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (41, 0, 'Shoulders', '', 'repeat', 1, 'kg', 1);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (42, 5, 'BMI', '', 'percent', 0, NULL, 1);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`) VALUES (43, 0, 'BMR', '', 'calorie', NULL, NULL, NULL);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (1, 0, 'Melső fekvőtámasz 1 perc', 'Ezt igazolja a 2016 márciusában beállított guinness rekord is,\r\namelyben KJ Joseph 1 perc alatt 82 szabályos karhajlítás-nyújtást\r\nvégzett.', 'repeat', 60, 'second', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (2, 0, 'Húzódzkodás', 'Ennek a gyakorlatnak a 24 órás csúcstartója Joonas Mäkipelto 5050\r\ngyakorlattal.', 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (3, 0, 'Melső fekvőtámasz 30mp', 'A gyakorlatot 30 másodperc alatt olyan sokszor kell végrehajtani, ahányszor a\r\nfelvételiző képes rá. Azonban törekedni kell a szabályos végrehajtásra, ugyanis csak azokat\r\nszámolják. A nők esetében 20, a férfiak esetében 35 gyakorlatot kell végrehajtani a maximális\r\npont megszerzéséért. A gyakorlat akkor sikeres, ha a női legalább 1, a férfi felvételiző\r\nlegalább 11 gyakorlatot képes végrehajtani.', 'repeat', 30, 'second', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (4, 0, 'Melső fekvőtámasz 2perc', 'Magyar Honvédség: A gyakorlat végrehajtására 2 perc áll rendelkezésre. Ennek során csak a szabályosan a\r\nfentiekben leírt módon végrehajtott gyakorlat értékelhető. Férfiaknál 70 karhajlítás nyújtást\r\nkell végrehajtani a maximális pontért.', 'repeat', 120, 'second', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (5, 0, 'Hajlított karú függés', 'A gyakorlat addig tart, amíg a végrehajtó szemmagassága a kiinduló helyzettől\r\nsüllyedve a keresztvas alá nem kerül. Az értékeléshez stopperórát alkalmaznak, és az\r\neredmény másodperc pontossággal kerül megállapításra. Nők esetében 45, férfiak\r\ntekintetében 73 másodperctől jár a maximális pontszám. A gyakorlat sikeres végrehajtásához\r\nlegalább 8, 10 másodpercig kell megtartaniuk a kiinduló helyzetet a női és a férfi\r\nfelvételizőknek.\r\n\r\nA NKE-RTK-án lévő hallgatók egyéni rekordjai Iván Viktor 90s, Kiss Regina 74s', 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (6, 0, 'Fekvenyomás', '2015-ben a fekvenyomó világbajnokságot Smulter Fredrik finn súlyemelő 401 Kg-al nyerte.\r\nA súlyzó tömege nők esetében 25 kg, a férfiak esetében 60 kg a rúddal együtt. Az\r\nértékelésénél a szabályosan végrehajtott gyakorlatokat értékelik csak.\r\nA legtöbb pontért 25 gyakorlatot kell végezni mind a nőknek, mind a férfiaknak. A minimum:\r\negy gyakorlat mindkét nem esetében.', 'repeat', NULL, 'kg', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (7, 0, '4x10m-es ingafutás', 'A legjobb pontszámért 9,4 s illetve 8,8s alatt kell teljesíteni a nőknek, férfiaknak. A\r\ngyakorlat sikertelen 11,8 s illetve 11,2 s-on túl.', 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (8, 0, 'Helyből távolugrás', 'Byron Jones 2015-ben a 3,73 méteres ugrásával érte el a világcsúcsot.\r\nA nőknek 220 cm-re, a férfiak 250 cm-re kell ugraniuk a maximális pontért. A\r\nminimális távolság 172cm illetve 198 cm.', 'meter', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (9, 0, 'Felülés hanyattfekvésből', 'Az NKE-RTK hallgatói közül Papp Zsófia 66 db-ot, Gál Valentin 80\r\ndb-ot csinált 1 perc leforgása alatt.\r\nElső ütemre megtörténik a felülés, ami akkor szabályos, ha valamelyik könyök érinti a\r\ntérdet. Második ütemre vissza kell térni a kiinduló helyzetbe. A maximális pont eléréséhez 1\r\nperc alatt 45 illetve 55 ismétlést kell végezni a nőknek illetve a férfiaknak. A minimumhoz 7\r\nés 25 ismétlés szükséges.', 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (10, 0, 'Felülés hajlított térddel', 'Magyar Honvédség: A kiinduló helyzet hajlított ülés, ennek során a sarkak a talajon, a térd 90 fokban meghajlítva\r\nvan.\r\nA gyakorlat végrehajtására két perc áll rendelkezésre. Ennek során csak a szabályosan,\r\na fentiekben leírt módon végrehajtott gyakorlat értékelhető. Férfiaknál, nőknél egyaránt 90\r\ngyakorlatot kell végrehajtani a maximális pontért. Amennyiben a megadott időkeret alatt nem\r\nsikerül legalább 25 szabályos gyakorlatot végrehajtani, úgy az sikertelennek minősül.', 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (11, 0, 'Síkfutás 2000m', 'A maximálisan megszerezhető pontot az a felvételiző gyűjtheti be, aki a távot nők\r\nesetében 10:00 perc alatt, férfiak esetében 7:35 perc alatt teljesíti. A gyakorlat sikeres\r\nteljesítésére nők esetében maximum 16:00 perc, férfiak esetében 13:30 perc áll rendelkezésre.', 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (30, 0, 'Cooper', '12 minutes run, how many meters', 'meter', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (31, 0, '300m', NULL, 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (32, 0, '400m', NULL, 'second', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (33, 0, 'Pushups', '', 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (34, 0, 'Timed Pushups', NULL, 'repeat', 1, 'second', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (35, 0, 'Squats', NULL, 'repeat', 1, 'kg', NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (36, 0, 'Sit-ups', NULL, 'repeat', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (37, 0, 'Chest Press', '', 'repeat', 1, 'kg', 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (38, 4, 'Pull Ups', '', 'repeat', NULL, NULL, 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (39, 0, 'Biceps', '', 'repeat', 1, 'kg', 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (40, 4, 'Triceps', 'Triceps', 'repeat', 1, 'kg', 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (41, 0, 'Shoulders', '', 'repeat', 1, 'kg', 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (42, 5, 'BMI', '', 'percent', 0, NULL, 1, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (43, 0, 'BMR', '', 'calorie', NULL, NULL, NULL, 0);
INSERT INTO `exercise_type` (`exercise_type_id`, `tree_id`, `name`, `description`, `unit`, `unit_quantity`, `unit_quantity_unit`, `active`, `base`) VALUES (63, 4, 'Chest Press', '', 'repeat', 0, 'kilogram', 1, 0);
/*!40000 ALTER TABLE `exercise_type` DISABLE KEYS */;

View File

@ -1,5 +1,6 @@
package com.aitrainer.api.model
import com.fasterxml.jackson.annotation.JsonIgnore
import org.hibernate.annotations.Fetch
import org.hibernate.annotations.FetchMode
import org.springframework.lang.NonNull
@ -15,9 +16,11 @@ data class ExerciseTree (
@get: NonNull var parentId: Int,
@get: NotBlank var name: String = "",
@get: NotBlank var imageUrl: String = "",
@get: NonNull var active: Boolean?,
@get: NonNull var active: Boolean?
) {
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "exerciseTree")
@Fetch(value = FetchMode.SUBSELECT)
val translations: List<ExerciseTreeTranslation> = mutableListOf<ExerciseTreeTranslation>().toList()
)
}

View File

@ -1,5 +1,6 @@
package com.aitrainer.api.model
import com.fasterxml.jackson.annotation.JsonIgnore
import javax.persistence.*
import javax.validation.constraints.NotBlank
@ -16,6 +17,7 @@ data class ExerciseTreeTranslation (
) {
@ManyToOne(fetch = FetchType.EAGER, optional = false)
@JoinColumn(name = "treeId", nullable = false)
@JsonIgnore
val exerciseTree: ExerciseTree? = null
}

View File

@ -16,17 +16,20 @@ data class ExerciseType(
@get: Null var unitQuantity: String?,
@get: Null var unitQuantityUnit: String?,
@get: NonNull var active: Boolean?,
@get: NonNull var base: Boolean?,
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
val exerciseTypeId: Long = 0,
val exerciseTypeId: Long = 0
) {
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "exerciseType")
@Fetch(value = FetchMode.SUBSELECT)
val images: List<ExerciseTypeImage> = mutableListOf<ExerciseTypeImage>()
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "exerciseType")
@Fetch(value = FetchMode.SUBSELECT)
val images: List<ExerciseTypeImage> = mutableListOf<ExerciseTypeImage>().toList(),
val translations: List<ExerciseTypeTranslation> = mutableListOf<ExerciseTypeTranslation>()
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "exerciseType")
@Fetch(value = FetchMode.SUBSELECT)
val translations: List<ExerciseTypeTranslation> = mutableListOf<ExerciseTypeTranslation>().toList()
)
}

View File

@ -1,5 +1,6 @@
package com.aitrainer.api.model
import com.fasterxml.jackson.annotation.JsonIgnore
import org.springframework.lang.NonNull
import javax.persistence.*
import javax.validation.constraints.NotBlank
@ -19,6 +20,7 @@ data class ExerciseTypeImage (
@ManyToOne(fetch = FetchType.EAGER, optional = false)
@JoinColumn(name="exerciseTypeId", nullable=false)
@JsonIgnore
val exerciseType: ExerciseType? = null
}

View File

@ -1,5 +1,6 @@
package com.aitrainer.api.model
import com.fasterxml.jackson.annotation.JsonIgnore
import org.springframework.lang.NonNull
import javax.persistence.*
import javax.validation.constraints.NotBlank
@ -18,5 +19,6 @@ data class ExerciseTypeTranslation (
@ManyToOne(fetch = FetchType.EAGER, optional = false)
@JoinColumn(name = "exerciseTypeId", nullable = false)
@JsonIgnore
val exerciseType: ExerciseType? = null
}

View File

@ -1,6 +1,6 @@
spring.profiles.active=prod
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
spring.datasource.url = jdbc:mysql://localhost:3306/aitrainer?serverTimezone=CET&useSSL=false&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&allowMultiQueries=true
spring.datasource.url = jdbc:mysql://62.171.188.119:33060/aitrainer?serverTimezone=CET&useSSL=false&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&allowMultiQueries=true
spring.datasource.username = aitrainer
spring.datasource.password = andio2009