Skip to content

Instantly share code, notes, and snippets.

@renanfranca
Created June 16, 2022 23:22
Show Gist options
  • Save renanfranca/494cd8ae69d8ade7a22a270834b06e8c to your computer and use it in GitHub Desktop.
Save renanfranca/494cd8ae69d8ade7a22a270834b06e8c to your computer and use it in GitHub Desktop.
//Starting define the entities
entity BabyProfile {
name String required
picture ImageBlob
birthday ZonedDateTime required
sign String
main Boolean
userId String required
}
entity Weight {
value Double required
date ZonedDateTime required
}
entity Height {
value Double required
date ZonedDateTime required
}
entity Humor {
value Integer required /** 1 to 5 ANGRY, SAD, CALM, HAPPY, EXCITED*/
description String required
emotico ImageBlob
}
entity HumorHistory {
// humor Humor - this field will be created though relationship
date ZonedDateTime
}
//enum Humor {
// ANGRY, SAD, CALM, HAPPY, EXCITED
//}
entity Nap {
start ZonedDateTime
end ZonedDateTime
// humor Humor - this field will be created though relationship
place Place
}
enum Place {
LAP, BABY_CRIB, CART, BABY_CONFORT
}
entity BreastFeed {
start ZonedDateTime
end ZonedDateTime
pain Pain
}
enum Pain {
NO_PAIN, DISCOMFORTING, DISTRESSING, INTENSE, UTTERLY_HORRIBLE, UNIMAGINABLE
}
//Define the relationships
relationship ManyToOne {
Weight{BabyProfile(name)} to BabyProfile
Height{BabyProfile(name)} to BabyProfile
HumorHistory{BabyProfile(name)} to BabyProfile
Nap{BabyProfile(name)} to BabyProfile
BreastFeed{BabyProfile(name)} to BabyProfile
HumorHistory{Humor(description)} to Humor
Nap{Humor(description)} to Humor
}
//Pagination
paginate Weight, Height, Humor, HumorHistory, Nap, BreastFeed with infinite-scroll
paginate BabyProfile with pagination
// Use Data Transfer Objects (DTO)
dto * with mapstruct
// Service layer
service all with serviceClass
@renanfranca
Copy link
Author

I created a project using this gist and explain it in my blog post:
Deploy jhipster monolithic (angular + spring boot) at fly.io for FREE

If you enjoyed this gist, please, considering give it a star ⭐ to support me and enhanced this gist's visibility 🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment