An open API service indexing awesome lists of open source software.

https://github.com/nfantoni/uml-to-code

Generate java code from xml uml description
https://github.com/nfantoni/uml-to-code

code-generator java-8 uml xml

Last synced: 10 months ago
JSON representation

Generate java code from xml uml description

Awesome Lists containing this project

README

          

# uml-to-code

## Generate java code from xml uml description

Based on the "Mapping UML diagram to XML" work by Jitender Singh for JNU that you can find
on [docs/utx_doc.pdf](docs/utx_doc.pdf).
The purpose of this project is take the xml rapresentation of uml diagram and generate
the relative java code that implement the CRUD access for various database pattern access.

### The mapping

To map a Uml we need to descripbe the output in a settings section and map the entity in a entities section.
The setting section is composed of:

- _defaultPackage_ : package to use in the java code jenerated
- _outputType_ : string that select the output type to generate for (DAO, HYBERNATE, BRUTE_FORCE)
- _outputPath_ : path where write the output code
- _useSurrogatesId_ : boolean value indacate to use or not surrugate ids

The entities block have to collect the entity description composed with:

- _ entyty_ :
- _name_ attribute : the calss name in camel case (``)
- _attribute_ childrens : the class attributes with :
- _name_ attribute : the name of the attribute
- _sqlType_ attribute : sql type of the attribute
- _null_ attribute : boolean value indicate the associated column allow null value or not
- _primaryKey_ attribute : boolean value indicate the associated column is primary key for the table

## Pattern DAO

With this example diagram:

![DAO EXAMPLE DIAGRAM](docs/dao_spettacoli.png)

it's enought write the xml rappresentation:

```xml


it.nfantoni.dao.test
DAO
target/dao
false















```

and run the program to generate all java classes for crud operation based on Dao Pattern.