Mysql maven jpa skeleton
- by coubeatczech
Hi, is there a skeleton for a project using mysql, some eclipse/top link with RESOURCE_LOCAL as connection type? Preferably using maven. I'm searching for it for hours and can't get running even the sipmlest exaple. So if you had it ready and running, please, post :-). Even something as simple as these two classes only.
@Entity
public class Message implements Serializable{
public Message() {}
public Message(String s){
this.s = s;
}
@Id
String s;
public String getS(){
return s;
}
}
public class App {
static private EntityManagerFactory emf;
static private EntityManager em;
public static void main( String[] args ) {
emf = Persistence.createEntityManagerFactory("persistence");
em = emf.createEntityManager();
Message m = new Message("abc");
em.persist(m);
}
}