Getting started !


1 - Create your project

Simply use maven with Sakarum Webapp Archetype to build your project

mvn archetype:generate -DgroupId=com.mycompany -DartifactId=myapp -DarchetypeGroupId=net.sourceforge.sakarum -DarchetypeArtifactId=sakarum-webapp-archetype -DarchetypeVersion=0.1.0.Alpha-SNAPSHOT -DarchetypeRepository=http://sakarum.sourceforge.net/maven2/

2 - Project setup

Configure your database properties in src/main/webapp/WEB-INF/application.properties


3 - Create your JPA 2 Entity

Create your entities in src/main/java/{com.mycompany.myapp.entity}, implements SakarumEntity and use JPA 2 annotations to configure database mapping

public class MyEntity implements SakarumEntity<Integer>{ //Specify the type of your entity key
			
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer id;

	[...]

	@Override
	public Integer getId(){
		return id;
	}

	@Override
	public void setId(Integer id){
		this.id = id;
	}

}


4 - Run Sakarum Generator plugin to create your Sakarum Application

mvn clean compile sakarum:generate

5 - Package your application with Maven

mvn package

6 - Deploy it and run it on Tomcat

Copy the generated war from src/target/xxxxx.war to your tomcat webapps directory and enjoy your application !


2012 - Sakarum Project - last update 2011.06.20