Hibernate erzeugt keine SQLite -Tabelle mit autoinkrementieren PKJava

Java-Forum
Anonymous
 Hibernate erzeugt keine SQLite -Tabelle mit autoinkrementieren PK

Post by Anonymous »

Ich habe das JPA Entity Country für ein Springboot-Projekt erstellt

Code: Select all

@Getter
@Setter
@Entity
@Data
public class Country {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(nullable = false)
private String name;

@Column(nullable = false)
private String region;

@Column(nullable = false)
private String continent;
}

Ich habe die Anwendung ausgeführt und die SQLite -Datenbankdatei wurde generiert. Country Tabelle:

Code: Select all

CREATE TABLE "country" (
"id"    INTEGER,
"continent" varchar(255) NOT NULL,
"name"  varchar(255) NOT NULL,
"region"    varchar(255) NOT NULL,
PRIMARY KEY("id")
);
< /code>
Dies ist meine Anwendungseigenschaften < /p>
spring.datasource.url=jdbc:sqlite:./database.sqlite
spring.datasource.driver-class-name=org.sqlite.JDBC
spring.jpa.database-platform=org.hibernate.community.dialect.SQLiteDialect
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.hbm2ddl.auto=update
spring.jpa.show-sql=true
Wie stelle ich sicher, dass das Schema der generierten Tabelle autoIncrement ?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post