Skip to content

Add entities using the JDL model admin #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .jhipster/Bet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "Bet",
"fields": [
{
"fieldName": "chips",
"fieldType": "BigDecimal"
},
{
"fieldName": "status",
"fieldType": "BetStatus",
"fieldValues": "Start,Finish,Cancel"
}
],
"relationships": [
{
"relationshipType": "many-to-one",
"otherEntityName": "gameUser",
"otherEntityRelationshipName": "bet",
"relationshipName": "user",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "hand",
"otherEntityRelationshipName": "bet",
"relationshipName": "hand",
"otherEntityField": "id"
}
],
"changelogDate": "20200401030800",
"entityTableName": "bet",
"dto": "no",
"pagination": "no",
"service": "no",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"readOnly": false,
"embedded": false,
"clientRootFolder": "",
"applications": "*"
}
21 changes: 21 additions & 0 deletions .jhipster/Game.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Game",
"fields": [
{
"fieldName": "name",
"fieldType": "String"
}
],
"relationships": [],
"changelogDate": "20200401030700",
"entityTableName": "game",
"dto": "no",
"pagination": "no",
"service": "no",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"readOnly": false,
"embedded": false,
"clientRootFolder": "",
"applications": "*"
}
36 changes: 36 additions & 0 deletions .jhipster/GameCommission.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "GameCommission",
"fields": [
{
"fieldName": "commission",
"fieldType": "Integer"
}
],
"relationships": [
{
"relationshipType": "many-to-one",
"otherEntityName": "game",
"otherEntityRelationshipName": "gameCommission",
"relationshipName": "game",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "gameUser",
"otherEntityRelationshipName": "commission",
"relationshipName": "gameUser",
"otherEntityField": "id"
}
],
"changelogDate": "20200401030600",
"entityTableName": "game_commission",
"dto": "no",
"pagination": "no",
"service": "no",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"readOnly": false,
"embedded": false,
"clientRootFolder": "",
"applications": "*"
}
50 changes: 50 additions & 0 deletions .jhipster/GameUser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "GameUser",
"fields": [
{
"fieldName": "username",
"fieldType": "String"
},
{
"fieldName": "password",
"fieldType": "String"
},
{
"fieldName": "chips",
"fieldType": "BigDecimal"
}
],
"relationships": [
{
"relationshipType": "one-to-many",
"otherEntityName": "gameCommission",
"otherEntityRelationshipName": "gameUser",
"relationshipName": "commission"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "role",
"otherEntityRelationshipName": "gameUser",
"relationshipName": "role",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "gameUser",
"otherEntityRelationshipName": "gameUser",
"relationshipName": "parent",
"otherEntityField": "id"
}
],
"changelogDate": "20200401030400",
"entityTableName": "game_user",
"dto": "no",
"pagination": "no",
"service": "no",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"readOnly": false,
"embedded": false,
"clientRootFolder": "",
"applications": "*"
}
47 changes: 47 additions & 0 deletions .jhipster/Hand.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "Hand",
"fields": [
{
"fieldName": "status",
"fieldType": "HandStatus",
"fieldValues": "Begin,End"
},
{
"fieldName": "winningChips",
"fieldType": "BigDecimal"
}
],
"relationships": [
{
"relationshipType": "one-to-many",
"otherEntityName": "bet",
"otherEntityRelationshipName": "hand",
"relationshipName": "bet"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "game",
"otherEntityRelationshipName": "hand",
"relationshipName": "game",
"otherEntityField": "id"
},
{
"relationshipType": "many-to-one",
"otherEntityName": "gameUser",
"otherEntityRelationshipName": "hand",
"relationshipName": "winner",
"otherEntityField": "id"
}
],
"changelogDate": "20200401030900",
"entityTableName": "hand",
"dto": "no",
"pagination": "no",
"service": "no",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"readOnly": false,
"embedded": false,
"clientRootFolder": "",
"applications": "*"
}
21 changes: 21 additions & 0 deletions .jhipster/Role.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Role",
"fields": [
{
"fieldName": "name",
"fieldType": "String"
}
],
"relationships": [],
"changelogDate": "20200401030500",
"entityTableName": "role",
"dto": "no",
"pagination": "no",
"service": "no",
"jpaMetamodelFiltering": false,
"fluentMethods": true,
"readOnly": false,
"embedded": false,
"clientRootFolder": "",
"applications": "*"
}
49 changes: 49 additions & 0 deletions admin.jh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
entity GameUser {
username String
password String
chips BigDecimal
}

entity Role {
name String
}

entity GameCommission {
commission Integer
}

entity Game {
name String
}

entity Bet {
chips BigDecimal
status BetStatus
}

enum BetStatus {
Start, Finish, Cancel
}

entity Hand {
status HandStatus
winningChips BigDecimal
}

enum HandStatus {
Begin, End
}

relationship ManyToOne {
Hand{game} to Game
GameCommission{game} to Game
Bet{user} to GameUser
Hand{winner} to GameUser
GameUser{role} to Role
GameUser{parent} to GameUser
}

relationship OneToMany {
GameUser{commission} to GameCommission
Hand{bet} to Bet{hand}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public JCacheManagerCustomizer cacheManagerCustomizer() {
createCache(cm, com.mycompany.myapp.domain.User.class.getName());
createCache(cm, com.mycompany.myapp.domain.Authority.class.getName());
createCache(cm, com.mycompany.myapp.domain.User.class.getName() + ".authorities");
createCache(cm, com.mycompany.myapp.domain.GameUser.class.getName());
createCache(cm, com.mycompany.myapp.domain.GameUser.class.getName() + ".commissions");
createCache(cm, com.mycompany.myapp.domain.Role.class.getName());
createCache(cm, com.mycompany.myapp.domain.GameCommission.class.getName());
createCache(cm, com.mycompany.myapp.domain.Game.class.getName());
createCache(cm, com.mycompany.myapp.domain.Bet.class.getName());
createCache(cm, com.mycompany.myapp.domain.Hand.class.getName());
createCache(cm, com.mycompany.myapp.domain.Hand.class.getName() + ".bets");
// jhipster-needle-ehcache-add-entry
};
}
Expand Down
Loading