new persistence work
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
package org.baeldung.ex.mappingexception.cause4.persistence.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class Foo implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private long id;
|
||||
|
||||
public Foo() {
|
||||
super();
|
||||
}
|
||||
|
||||
// API
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(final long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
hibernate.connection.username=tutorialuser
|
||||
hibernate.connection.password=tutorialmy5ql
|
||||
hibernate.connection.driver_class=com.mysql.jdbc.Driver
|
||||
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
|
||||
#hibernate.connection.datasource=jdbc:mysql://localhost:3306/spring_hibernate4_exceptions?createDatabaseIfNotExist=true
|
||||
hibernate.connection.url=jdbc:mysql://localhost:3306/spring_hibernate4_exceptions?createDatabaseIfNotExist=true
|
||||
hibernate.show_sql=false
|
||||
hibernate.hbm2ddl.auto=create
|
||||
Reference in New Issue
Block a user