Testing JDL Studio for JHipster application


The newest version of JHipster gives us an opportunity to generate backbone model in 3 different ways. Today we will test the fastest one 🙂 JHipster since version 4.x provided great tool which creates the World a better place. This tool is JDL Studio available here. You can prototype there whole models at once and generate it everytime you would like to.

Available data types

You can prototype your classes with defined below types of fields. Relational and non-relational databases sometimes have different types, just remember about it.

 

SQL MongoDB Cassandra Validations
String String String required, minlength, maxlength, pattern
Integer Integer Integer required, min, max
Long Long Long required, min, max
BigDecimal BigDecimal BigDecimal required, min, max
Float Float Float required, min, max
Double Double Double required, min, max
Enum Enum required
Boolean Boolean Boolean required
LocalDate LocalDate required
Date required
ZonedDateTime ZonedDateTime required
UUID required
Blob Blob required, minbytes, maxbytes
AnyBlob AnyBlob required, minbytes, maxbytes
ImageBlob ImageBlob required, minbytes, maxbytes
TextBlob TextBlob required, minbytes, maxbytes

Relationships

Available are all relationships: 1:1, 1:n, n:1, m:n. You can always choose if any of those relations is bidirectional or unidirectional.

 

  • <type> is the type of your relationship (OneToMany | ManyToOne| OneToOne | ManyToMany)
  • <from entity> is the name of the entity owner of the relationship,
  • <to entity> is the name of the entity where the relationship goes to,
  • <relationship name> is the name of the relationship in the entity.

Enumerations and blobs

They are also available, what can I say more 😉 You can also define some constant values (like PI) and use it in entity model.

 

Option declaration

In JHipster  you can specify options for entities such as generating pagination, service or DTO. Example from docs:

  • paginate enable pagination for the entity with pager | pagination | infinite-scroll
  • service enable service layer for the entity with serviceClass | serviceImpl
  • dto enable DTO for the entity with Mapstruct
  • skipClient skip client side code for entity
  • skipServer skip server side code for entity
  • angularSuffix add a suffix to angular route names
  • microservice specify the app name of entity from another microservice
  • search specify search option for entity from another microservice

Error handling

Web interface returns errors on the top of the schema and shows red stripe on the left. If you use wrong syntax, it will try to show what is expected, how should looks like and – for me the most important – which line has failed. Remember, that you shouldn’t leave commas a the end of enumeration of class parameters 😉

 

Example JDL Studio

How the generated schema model looks like?

Next time we will be generating these data into EventSearch application. We will use magic command:

No votes yet.
Please wait...
Paweł Dobrzański

Start-up's fan, technological conferences member, social media enthusiast and low-cost trips traveler.

You may also like

Bądź na bieżąco na FB!

Cześć!

Witaj na moim blogu! Znajdziesz tu proces budowania mojej aplikacji EventSearch za pomocą jhipstera. Podzielę się z Tobą niuansami dot. zakładania i prowadzenia firmy. Mam również nadzieję, że pomogę Ci zaoszczędzić trochę pieniędzy. Zapraszam!

Sociale

Promocja na helionie!

Angular 2. Tworzenie interaktywnych aplikacji internetowych

autor: Gion Kunz

Cena: 59.00 zł
(Cena e-booka: 47.20 zł)

nowość bestseller

Najpopularniejsze posty

Dzięki, że wpadłeś!

Paweł Dobrzański

Paweł Dobrzański

Start-up's fan, technological conferences member, social media enthusiast and low-cost trips traveler.