Hibernate can now actually create tables.
This commit is contained in:
parent
a368677573
commit
dec5f4252b
@ -8,6 +8,7 @@ database:
|
|||||||
# any properties specific to your JDBC driver:
|
# any properties specific to your JDBC driver:
|
||||||
properties:
|
properties:
|
||||||
foreign_keys: true
|
foreign_keys: true
|
||||||
|
hibernate.hbm2ddl.auto: create
|
||||||
|
|
||||||
server:
|
server:
|
||||||
rootPath: /api/
|
rootPath: /api/
|
@ -7,6 +7,7 @@ import lombok.NoArgsConstructor;
|
|||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
|
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.MappedSuperclass;
|
import javax.persistence.MappedSuperclass;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -19,6 +20,6 @@ class BaseEntity implements Serializable {
|
|||||||
@NonNull
|
@NonNull
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private long id;
|
private long id;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ public class SiteDao extends AbstractDAO<Site> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Site> listAll(){
|
public List<Site> listAll(){
|
||||||
return list(criteriaQuery());
|
return currentSession().createQuery("from Site", Site.class).list();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Site get(long id){
|
public Site get(long id){
|
||||||
|
Loading…
Reference in New Issue
Block a user