不能使用jpa和hibernate在Postgres中创建表

时间:2019-04-24 14:56:08

标签: postgresql hibernate jpa

我尝试使用hibernate和jpa在PostgreSQL中生成表,但这不起作用,控制台中没有错误。

Get file= "C:\Users\gaurelien\WRMA\APS-TARC - Documents\NAMRS DATA Reports\Report Redesign\2018 Structure\Archive\5. Who are the Perpetrators(how is client perp related)\Working folder\Relationship.sav".

sort cases by CaseDataSetID(a) InvestigationId(a) PerpetratorId(a) ClientID(a) StateName (a).
ALTER TYPE StateName(a28).
Save outfile="C:\Users\gaurelien\WRMA\APS-TARC - Documents\NAMRS DATA Reports\Report Redesign\2018 Structure\Archive\5. Who are the Perpetrators(how is client perp related)\Working folder\RelationshipFinal.sav".

Get file= "C:\Users\gaurelien\WRMA\APS-TARC - Documents\NAMRS DATA Reports\Report Redesign\2018 Structure\NAMRS Report Redesign\Exhibits Missing\Working Folder\MaltPerpFinal2017.sav".
sort cases by CaseDataSetID(a) InvestigationId(a)  PerpetratorId(a) ClientID(a) StateName (a).
ALTER TYPE StateName(a28).
save outfile= "C:\Users\gaurelien\WRMA\APS-TARC - Documents\NAMRS DATA Reports\Report Redesign\2018 Structure\Archive\5. Who are the Perpetrators(how is client perp related)\Working folder\MaltPerpFinal2017.sav".

MATCH FILES file="C:\Users\gaurelien\WRMA\APS-TARC - Documents\NAMRS DATA Reports\Report Redesign\2018 Structure\Archive\5. Who are the Perpetrators(how is client perp related)\Working folder\MaltPerpFinal2017.sav" 
      /Table="C:\Users\gaurelien\WRMA\APS-TARC - Documents\NAMRS DATA Reports\Report Redesign\2018 Structure\Archive\5. Who are the Perpetrators(how is client perp related)\Working folder\RelationshipFinal.sav" /by CaseDataSetID
      InvestigationId PerpetratorID ClientID StateName.
Execute.

Save OUTFILE="C:\Users\gaurelien\WRMA\APS-TARC - Documents\NAMRS DATA Reports\Report Redesign\2018 Structure\Archive\5. Who are the Perpetrators(how is client perp related)\Working folder\RelationshipFinal2017.sav".

这是实体

spring.datasource.platform=org.hibernate.dialect.postgres
spring.datasource.url=jdbc:postgresql://localhost:5433/pfeDb
spring.datasource.username=postgres
spring.datasource.password=Nstg_Correlation
spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true

这是主要的类:

@Entity
@Getter @Setter @NoArgsConstructor @AllArgsConstructor
public class Catalogue implements Serializable{

 @Id
  private Long id_catalogue;

  private String nom_catalogue;
  private String description;
  private String sujet_catalogue;
  private boolean nouveau_catalogue;
  private boolean edition_en_cours;
  private String commentaire_catalogue;

  }

1 个答案:

答案 0 :(得分:0)

尝试将@Table注释添加到您的实体。

@Entity
@Table
@Getter 
@Setter 
@NoArgsConstructor 
@AllArgsConstructor
public class Catalogue implements Serializable{

    @Id
    private Long idCatalogue;
    private String nomCatalogue;
    private String description;
    private String sujetCatalogue;
    private boolean nouveauCatalogue;
    private boolean editionEnCours;
    private String commentaireCatalogue;

}

对于Java字段,变量等,请使用驼峰式大小写而不是蛇形大小写。