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
- Host: GitHub
- URL: https://github.com/nfantoni/uml-to-code
- Owner: nfantoni
- License: mit
- Created: 2019-08-31T09:55:22.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2021-04-26T19:30:55.000Z (about 5 years ago)
- Last Synced: 2025-06-04T08:02:45.277Z (about 1 year ago)
- Topics: code-generator, java-8, uml, xml
- Language: Java
- Size: 1.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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:

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.