0

I have an application built with Sprigboot (2.4.5) Spring JPA and Eclipselink. It connects to MariaDB. The CREATE table statements the application is generating are structured as VARCHAR without a size. However, I would have expected expect VARCHAR(255). MariaDB rejects the VARCHAR statements and fails to create tables. I am sure I am missing something really really obvious here - so I apologize in advance! But hoping for some guidance. This is an example of the generated code:

CREATE TABLE api_user (ID NUMBER(19) NOT NULL, apiKey VARCHAR, assignDate TIMESTAMP, code VARCHAR UNIQUE, disabled VARCHAR, expiryDate TIMESTAMP, name VARCHAR, version NUMBER(19), PRIMARY KEY (ID))


eclipselinkDdlGeneration=drop-and-create-tables
eclipselinkDdlGenerationOutputMode=database
eclipselinkJdbcUppercaseColumns=false
eclipselinkWeaving=false

dbDriver=org.mariadb.jdbc.Driver
skyman
  • 2,255
  • 4
  • 32
  • 55
  • What database platform class have you specified? The types used for DDL generation are defined within the DatabasePlatform subclass - I would guess you are using the base DatabasePlatform instance since I don't think there is one for MariaDb. You might try specifying the Mysql one as described here https://stackoverflow.com/questions/61690913/problems-with-java-generatedvalue-strategy-generationtype-identity-using-ma – Chris Oct 01 '21 at 21:47
  • I have been thinking this, but I have been using the same basic code for years without an issue - I have update the question with additional snips – skyman Oct 01 '21 at 23:20
  • @Chris I just checked your reference. Thank you it solved the issue. Oracle are fortunate to have you :) – skyman Oct 01 '21 at 23:55

0 Answers0