Cayenne Maven Demo
Prerequisites
You will need JDK, git and maven for this demo.
Usage
-
Clone this repo:
git clone https://github.com/stariy95/cayenne-maven-demo.git
-
Create demo DB using on of
sql
scripts provided insrc/main/resources
directory -
Setup DB connection in
pom.xml
:
<dataSource>
<url>jdbc:mysql://localhost/demo</url>
<driver>com.mysql.jdbc.Driver</driver>
<username>root</username>
<password>password</password>
</dataSource>
and in src/main/resources/cayenne-project.xml
(edit DataNode via Modeler)
- Run
mvn cayenne:cdbimport
to create data map from DB - Run
mvn cayenne:cgen
to generate classes - Run
mvn package
to compile Demo and create Jar file - Run this demo
java -jar target/cayenne-maven-demo-1.0-SNAPSHOT.jar