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:
|
||||
properties:
|
||||
foreign_keys: true
|
||||
hibernate.hbm2ddl.auto: create
|
||||
|
||||
server:
|
||||
rootPath: /api/
|
@ -7,6 +7,7 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.NonNull;
|
||||
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import java.io.Serializable;
|
||||
@ -19,6 +20,6 @@ class BaseEntity implements Serializable {
|
||||
@NonNull
|
||||
@JsonProperty
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private long id;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public class SiteDao extends AbstractDAO<Site> {
|
||||
}
|
||||
|
||||
public List<Site> listAll(){
|
||||
return list(criteriaQuery());
|
||||
return currentSession().createQuery("from Site", Site.class).list();
|
||||
}
|
||||
|
||||
public Site get(long id){
|
||||
|
Loading…
Reference in New Issue
Block a user