JPASamartGenerator create smaple file
Generate JPA entities with relations in fast way
Brought to you by:
mohammed85
Welcome to your wiki!
This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
The wiki uses Markdown syntax.
When You run the programe you need to choose file that describe the relation between the enetites.
in this post you will learn how to create this file.
At the first time you must specifiy the output directory you need to generate source on it :
src=C://JPA//Sample
the previous line will tell the tool where to generate the java source code. suppose we have two entities Employee and Project and we want to define relation between them.
Employee :1:m: Project
in the previous line you tell thae tool that the relation is one to many,
if relation many to many then:
Employee Ⓜ️m: Project
if relation is many to one then
Employee Ⓜ️1: Project
and so on
when you run the programe with this tutorials then will generate Employee,java and
Project.java in Sample Directoruy
in you put more than two entities in one line let us take example:
Employee :1:m: Project Company Employee
in previour line will specify one to many relation for muliple entities
also you can do
'Project Company Employee Ⓜ️1:Employee
also you can specify the package for the entities:
Employee :1:m: Project -> emlpoyee
Employee and Project will be in ecmployee package
You can repaet entity on lines :
Employee :1:m: Project
Branch :1:m: Employee
use #package
src=c:/JPA/sample
package= domain.model
Employee :1:m: Project -> employee
the two entities will be in domain.model.employee package