[FIX] back compatibility of mySQL and SQLite

This commit is contained in:
Edouard DUPIN 2024-12-29 16:13:34 +01:00
parent e8c6771b79
commit 820cf7d3d2
8 changed files with 208 additions and 170 deletions

View File

@ -802,7 +802,7 @@ public class DBAccessSQL extends DBAccess {
final List<Field> asyncFieldUpdate = new ArrayList<>(); final List<Field> asyncFieldUpdate = new ArrayList<>();
Long uniqueSQLID = null; Long uniqueSQLID = null;
UUID uniqueSQLUUID = null; UUID uniqueSQLUUID = null;
final String tableName = this.db.getCongig().getDbName() + "." + AnnotationTools.getTableName(clazz, options); final String tableName = AnnotationTools.getTableName(clazz, options);
Field primaryKeyField = null; Field primaryKeyField = null;
boolean generateUUID = false; boolean generateUUID = false;
// real add in the BDD: // real add in the BDD:
@ -1031,8 +1031,7 @@ public class DBAccessSQL extends DBAccess {
final List<LazyGetter> asyncActions = new ArrayList<>(); final List<LazyGetter> asyncActions = new ArrayList<>();
// real add in the BDD: // real add in the BDD:
try { try {
final String tableName = this.db.getCongig().getDbName() + "." final String tableName = AnnotationTools.getTableName(clazz, options);
+ AnnotationTools.getTableName(clazz, options);
// boolean createIfNotExist = clazz.getDeclaredAnnotationsByType(SQLIfNotExists.class).length != 0; // boolean createIfNotExist = clazz.getDeclaredAnnotationsByType(SQLIfNotExists.class).length != 0;
final StringBuilder query = new StringBuilder(); final StringBuilder query = new StringBuilder();
query.append("UPDATE `"); query.append("UPDATE `");
@ -1207,7 +1206,6 @@ public class DBAccessSQL extends DBAccess {
) throws Exception { ) throws Exception {
final boolean readAllfields = QueryOptions.readAllColomn(options); final boolean readAllfields = QueryOptions.readAllColomn(options);
final String tableName = AnnotationTools.getTableName(clazz, options); final String tableName = AnnotationTools.getTableName(clazz, options);
//final String tableName = this.db.getCongig().getDbName() + "." + AnnotationTools.getTableName(clazz, options);
final String primaryKey = AnnotationTools.getPrimaryKeyField(clazz).getName(); final String primaryKey = AnnotationTools.getPrimaryKeyField(clazz).getName();
boolean firstField = true; boolean firstField = true;
@ -1254,8 +1252,7 @@ public class DBAccessSQL extends DBAccess {
final CountInOut count = new CountInOut(); final CountInOut count = new CountInOut();
final StringBuilder querySelect = new StringBuilder(); final StringBuilder querySelect = new StringBuilder();
StringBuilder query = new StringBuilder(); StringBuilder query = new StringBuilder();
final String tableName = this.db.getCongig().getDbName() + "." final String tableName = AnnotationTools.getTableName(clazz, options);
+ AnnotationTools.getTableName(clazz, options);
querySelect.append("SELECT "); querySelect.append("SELECT ");
query.append(" FROM `"); query.append(" FROM `");
query.append(tableName); query.append(tableName);
@ -1361,8 +1358,7 @@ public class DBAccessSQL extends DBAccess {
// real add in the BDD: // real add in the BDD:
try { try {
final StringBuilder query = new StringBuilder(); final StringBuilder query = new StringBuilder();
final String tableName = this.db.getCongig().getDbName() + "." final String tableName = AnnotationTools.getTableName(clazz, options);
+ AnnotationTools.getTableName(clazz, options);
query.append("SELECT COUNT(*) AS count FROM `"); query.append("SELECT COUNT(*) AS count FROM `");
query.append(tableName); query.append(tableName);
query.append("` "); query.append("` ");
@ -1400,7 +1396,7 @@ public class DBAccessSQL extends DBAccess {
public long deleteHardWhere(final Class<?> clazz, final QueryOption... option) throws Exception { public long deleteHardWhere(final Class<?> clazz, final QueryOption... option) throws Exception {
final QueryOptions options = new QueryOptions(option); final QueryOptions options = new QueryOptions(option);
final Condition condition = conditionFusionOrEmpty(options, true); final Condition condition = conditionFusionOrEmpty(options, true);
final String tableName = this.db.getCongig().getDbName() + "." + AnnotationTools.getTableName(clazz, options); final String tableName = AnnotationTools.getTableName(clazz, options);
final String deletedFieldName = AnnotationTools.getDeletedFieldName(clazz); final String deletedFieldName = AnnotationTools.getDeletedFieldName(clazz);
// find the deleted field // find the deleted field
final StringBuilder query = new StringBuilder(); final StringBuilder query = new StringBuilder();
@ -1419,7 +1415,7 @@ public class DBAccessSQL extends DBAccess {
public long deleteSoftWhere(final Class<?> clazz, final QueryOption... option) throws Exception { public long deleteSoftWhere(final Class<?> clazz, final QueryOption... option) throws Exception {
final QueryOptions options = new QueryOptions(option); final QueryOptions options = new QueryOptions(option);
final Condition condition = conditionFusionOrEmpty(options, true); final Condition condition = conditionFusionOrEmpty(options, true);
final String tableName = this.db.getCongig().getDbName() + "." + AnnotationTools.getTableName(clazz, options); final String tableName = AnnotationTools.getTableName(clazz, options);
final String deletedFieldName = AnnotationTools.getDeletedFieldName(clazz); final String deletedFieldName = AnnotationTools.getDeletedFieldName(clazz);
/* String updateFieldName = null; if ("sqlite".equalsIgnoreCase(ConfigBaseVariable.getDBType())) { updateFieldName = AnnotationTools.getUpdatedFieldName(clazz); } */ /* String updateFieldName = null; if ("sqlite".equalsIgnoreCase(ConfigBaseVariable.getDBType())) { updateFieldName = AnnotationTools.getUpdatedFieldName(clazz); } */
// find the deleted field // find the deleted field
@ -1445,7 +1441,7 @@ public class DBAccessSQL extends DBAccess {
public long unsetDeleteWhere(final Class<?> clazz, final QueryOption... option) throws DataAccessException { public long unsetDeleteWhere(final Class<?> clazz, final QueryOption... option) throws DataAccessException {
final QueryOptions options = new QueryOptions(option); final QueryOptions options = new QueryOptions(option);
final Condition condition = conditionFusionOrEmpty(options, true); final Condition condition = conditionFusionOrEmpty(options, true);
final String tableName = this.db.getCongig().getDbName() + "." + AnnotationTools.getTableName(clazz, options); final String tableName = AnnotationTools.getTableName(clazz, options);
final String deletedFieldName = AnnotationTools.getDeletedFieldName(clazz); final String deletedFieldName = AnnotationTools.getDeletedFieldName(clazz);
if (deletedFieldName == null) { if (deletedFieldName == null) {
throw new DataAccessException("The class " + clazz.getCanonicalName() + " has no deleted field"); throw new DataAccessException("The class " + clazz.getCanonicalName() + " has no deleted field");
@ -1473,7 +1469,7 @@ public class DBAccessSQL extends DBAccess {
@Override @Override
public void drop(final Class<?> clazz, final QueryOption... option) throws Exception { public void drop(final Class<?> clazz, final QueryOption... option) throws Exception {
final QueryOptions options = new QueryOptions(option); final QueryOptions options = new QueryOptions(option);
final String tableName = this.db.getCongig().getDbName() + "." + AnnotationTools.getTableName(clazz, options); final String tableName = AnnotationTools.getTableName(clazz, options);
final StringBuilder query = new StringBuilder(); final StringBuilder query = new StringBuilder();
query.append("DROP TABLE IF EXISTS `"); query.append("DROP TABLE IF EXISTS `");
query.append(tableName); query.append(tableName);
@ -1501,7 +1497,7 @@ public class DBAccessSQL extends DBAccess {
@Override @Override
public void cleanAll(final Class<?> clazz, final QueryOption... option) throws Exception { public void cleanAll(final Class<?> clazz, final QueryOption... option) throws Exception {
final QueryOptions options = new QueryOptions(option); final QueryOptions options = new QueryOptions(option);
final String tableName = this.db.getCongig().getDbName() + "." + AnnotationTools.getTableName(clazz, options); final String tableName = AnnotationTools.getTableName(clazz, options);
final StringBuilder query = new StringBuilder(); final StringBuilder query = new StringBuilder();
query.append("DELETE FROM `"); query.append("DELETE FROM `");
query.append(tableName); query.append(tableName);

View File

@ -28,8 +28,6 @@ import jakarta.persistence.GenerationType;
public class DataFactory { public class DataFactory {
private static final Logger LOGGER = LoggerFactory.getLogger(DataFactory.class); private static final Logger LOGGER = LoggerFactory.getLogger(DataFactory.class);
public static final String DEFAULT_DB_NAME_INVALID = "@__ZZZ__TABLE_NAME__ZZZ__@.";
public static String convertTypeInSQL(final Class<?> type, final String fieldName) throws DataAccessException { public static String convertTypeInSQL(final Class<?> type, final String fieldName) throws DataAccessException {
final String typelocal = ConfigBaseVariable.getDBType(); final String typelocal = ConfigBaseVariable.getDBType();
if ("mysql".equals(typelocal)) { if ("mysql".equals(typelocal)) {
@ -331,7 +329,7 @@ public class DataFactory {
} }
public static List<String> createTable(final Class<?> clazz, final QueryOptions options) throws Exception { public static List<String> createTable(final Class<?> clazz, final QueryOptions options) throws Exception {
final String tableName = DEFAULT_DB_NAME_INVALID + "." + AnnotationTools.getTableName(clazz, options); final String tableName = AnnotationTools.getTableName(clazz, options);
boolean createDrop = false; boolean createDrop = false;
if (options != null) { if (options != null) {

View File

@ -13,10 +13,10 @@ public class DbConfig {
static final Logger LOGGER = LoggerFactory.getLogger(DBAccess.class); static final Logger LOGGER = LoggerFactory.getLogger(DBAccess.class);
private final String type; private final String type;
private final String hostname; private final String hostname;
private final int port; private final Short port;
private final String login; private final String login;
private final String password; private final String password;
private final String dbName; private String dbName;
private final boolean keepConnected; private final boolean keepConnected;
private final List<Class<?>> classes; private final List<Class<?>> classes;
@ -90,6 +90,10 @@ public class DbConfig {
return this.dbName; return this.dbName;
} }
public void setDbName(final String dbName) {
this.dbName = dbName;
}
public boolean getKeepConnected() { public boolean getKeepConnected() {
return this.keepConnected; return this.keepConnected;
} }
@ -99,14 +103,7 @@ public class DbConfig {
} }
public String getUrl() { public String getUrl() {
return getUrl(false);
}
public String getUrl(final boolean isRoot) {
if (this.type.equals("sqlite")) { if (this.type.equals("sqlite")) {
if (isRoot) {
LOGGER.error("Can not manage root connection on SQLite...");
}
if (this.hostname.equals("memory")) { if (this.hostname.equals("memory")) {
return "jdbc:sqlite::memory:"; return "jdbc:sqlite::memory:";
} }
@ -116,12 +113,12 @@ public class DbConfig {
return "mongodb://" + getLogin() + ":" + getPassword() + "@" + this.hostname + ":" + this.port; return "mongodb://" + getLogin() + ":" + getPassword() + "@" + this.hostname + ":" + this.port;
} }
if ("mysql".equals(this.type)) { if ("mysql".equals(this.type)) {
LOGGER.warn("Request log on SQL: isRoot={}", isRoot); if (this.dbName == null || this.dbName.isEmpty()) {
if (isRoot) { LOGGER.warn("Request log on SQL: root");
return "jdbc:" + this.type + "://" + this.hostname + ":" + this.port return "jdbc:" + this.type + "://" + this.hostname + ":" + this.port
+ "/?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC"; + "/?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC";
} }
return "jdbc:" + this.type + "://" + this.hostname + ":" + this.port // + "/" + this.dbName return "jdbc:" + this.type + "://" + this.hostname + ":" + this.port + "/" + this.dbName
+ "?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC"; + "?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC";
} }
return "dead_code"; return "dead_code";
@ -136,7 +133,7 @@ public class DbConfig {
return false; return false;
} }
if (other instanceof final DbConfig dbConfig) { if (other instanceof final DbConfig dbConfig) {
return this.port == dbConfig.port // return Objects.equals(this.port, dbConfig.port) //
&& this.keepConnected == dbConfig.keepConnected // && this.keepConnected == dbConfig.keepConnected //
&& Objects.equals(this.type, dbConfig.type) // && Objects.equals(this.type, dbConfig.type) //
&& Objects.equals(this.hostname, dbConfig.hostname) // && Objects.equals(this.hostname, dbConfig.hostname) //
@ -153,4 +150,16 @@ public class DbConfig {
return Objects.hash(this.type, this.hostname, this.port, this.login, this.password, this.dbName, return Objects.hash(this.type, this.hostname, this.port, this.login, this.password, this.dbName,
this.keepConnected, this.classes); this.keepConnected, this.classes);
} }
@Override
public DbConfig clone() {
try {
return new DbConfig(this.type, this.hostname, this.port, this.login, this.password, this.dbName,
this.keepConnected, this.classes);
} catch (final DataAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
} }

View File

@ -4,7 +4,6 @@ import java.io.IOException;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.kar.archidata.dataAccess.DBAccess; import org.kar.archidata.dataAccess.DBAccess;
import org.kar.archidata.dataAccess.DBAccessSQL; import org.kar.archidata.dataAccess.DBAccessSQL;
@ -104,25 +103,7 @@ public class MigrationEngine {
} }
} }
public void migrateErrorThrow(final DbConfig config) throws MigrationException { private void listAvailableMigration() throws MigrationException {
try (final DBAccess da = DBAccess.createInterface(config)) {
migrateErrorThrow(config, da);
} catch (final InternalServerErrorException e) {
e.printStackTrace();
throw new MigrationException("TODO ...");
} catch (final IOException e) {
e.printStackTrace();
throw new MigrationException("TODO ...");
}
}
/** Process the automatic migration of the system
* @param config SQL connection for the migration
* @throws IOException Error if access on the DB */
@SuppressFBWarnings({ "SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING",
"SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE" })
public void migrateErrorThrow(final DbConfig config, final DBAccess da) throws MigrationException {
LOGGER.info("Execute migration ... [BEGIN]");
// check the integrity of the migrations: // check the integrity of the migrations:
LOGGER.info("List of availlable Migration: "); LOGGER.info("List of availlable Migration: ");
for (final MigrationInterface elem : this.datas) { for (final MigrationInterface elem : this.datas) {
@ -146,18 +127,23 @@ public class MigrationEngine {
} }
} }
} }
// STEP 1: Check the DB exist:
LOGGER.info("Verify existance of '{}'", config.getDbName());
boolean exist = da.isDBExist(config.getDbName());
if (!exist) {
LOGGER.warn("DB: '{}' DOES NOT EXIST ==> create one", config.getDbName());
// create the local DB:
da.createDB(config.getDbName());
} }
exist = da.isDBExist(config.getDbName());
private void createTableIfAbleOrWaitAdmin(final DbConfig configInput) throws MigrationException {
final DbConfig config = configInput.clone();
config.setDbName(null);
final String dbName = configInput.getDbName();
LOGGER.info("Verify existance of '{}'", dbName);
try (final DBAccess da = DBAccess.createInterface(config)) {
boolean exist = da.isDBExist(dbName);
if (!exist) {
LOGGER.warn("DB: '{}' DOES NOT EXIST ==> create one", dbName);
// create the local DB:
da.createDB(dbName);
}
exist = da.isDBExist(dbName);
while (!exist) { while (!exist) {
LOGGER.error("DB: '{}' DOES NOT EXIST after trying to create one ", config.getDbName()); LOGGER.error("DB: '{}' DOES NOT EXIST after trying to create one ", dbName);
LOGGER.error("Waiting administrator create a new one, we check after 30 seconds..."); LOGGER.error("Waiting administrator create a new one, we check after 30 seconds...");
try { try {
Thread.sleep(30000); Thread.sleep(30000);
@ -165,13 +151,33 @@ public class MigrationEngine {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
exist = da.isDBExist(config.getDbName()); exist = da.isDBExist(dbName);
} }
} catch (final InternalServerErrorException e) {
e.printStackTrace();
throw new MigrationException("TODO ...");
} catch (final IOException e) {
e.printStackTrace();
throw new MigrationException("TODO ...");
}
}
/** Process the automatic migration of the system
* @param config SQL connection for the migration
* @throws IOException Error if access on the DB */
@SuppressFBWarnings({ "SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING",
"SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE" })
public void migrateErrorThrow(final DbConfig config) throws MigrationException {
LOGGER.info("Execute migration ... [BEGIN]");
listAvailableMigration();
// STEP 1: Check the DB exist:
createTableIfAbleOrWaitAdmin(config);
LOGGER.info("DB '{}' exist.", config.getDbName()); LOGGER.info("DB '{}' exist.", config.getDbName());
try (final DBAccess da = DBAccess.createInterface(config)) {
// STEP 2: Check migration table exist: // STEP 2: Check migration table exist:
LOGGER.info("Verify existance of migration table '{}'", "KAR_migration"); LOGGER.info("Verify existance of migration table '{}'", "KAR_migration");
if (da instanceof final DBAccessSQL daSQL) { if (da instanceof final DBAccessSQL daSQL) {
exist = da.isTableExist("KAR_migration"); final boolean exist = da.isTableExist("KAR_migration");
if (!exist) { if (!exist) {
LOGGER.info("'{}' Does not exist create a new one...", "KAR_migration"); LOGGER.info("'{}' Does not exist create a new one...", "KAR_migration");
// create the table: // create the table:
@ -183,10 +189,6 @@ public class MigrationEngine {
throw new MigrationException( throw new MigrationException(
"Fail to create the local DB SQL model for migaration ==> wait administrator interventions"); "Fail to create the local DB SQL model for migaration ==> wait administrator interventions");
} }
sqlQuery = sqlQuery.stream()
.map(query -> query.replace(DataFactory.DEFAULT_DB_NAME_INVALID, config.getDbName()))
.collect(Collectors.toList());
LOGGER.info("Create Table with : {}", sqlQuery.get(0)); LOGGER.info("Create Table with : {}", sqlQuery.get(0));
try { try {
daSQL.executeQuery(sqlQuery.get(0)); daSQL.executeQuery(sqlQuery.get(0));
@ -263,6 +265,13 @@ public class MigrationEngine {
} }
} }
LOGGER.info("Execute migration ... [ END ]"); LOGGER.info("Execute migration ... [ END ]");
} catch (final InternalServerErrorException e) {
e.printStackTrace();
throw new MigrationException("TODO ...");
} catch (final IOException e) {
e.printStackTrace();
throw new MigrationException("TODO ...");
}
} }
public void migrateSingle(final DBAccess da, final MigrationInterface elem, final int id, final int count) public void migrateSingle(final DBAccess da, final MigrationInterface elem, final int id, final int count)

View File

@ -4,6 +4,7 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import org.kar.archidata.dataAccess.DBAccess; import org.kar.archidata.dataAccess.DBAccess;
import org.kar.archidata.db.DbConfig;
import org.kar.archidata.db.DbIoFactory; import org.kar.archidata.db.DbIoFactory;
import org.kar.archidata.exception.DataAccessException; import org.kar.archidata.exception.DataAccessException;
import org.kar.archidata.tools.ConfigBaseVariable; import org.kar.archidata.tools.ConfigBaseVariable;
@ -36,7 +37,7 @@ import test.kar.archidata.dataAccess.model.TypesTable;
public class ConfigureDb { public class ConfigureDb {
final static private Logger LOGGER = LoggerFactory.getLogger(ConfigureDb.class); final static private Logger LOGGER = LoggerFactory.getLogger(ConfigureDb.class);
final static private String modeTestForced = "MY-SQL"; final static private String modeTestForced = null; // "MONGO";
public static DBAccess da = null; public static DBAccess da = null;
public static void configure() throws IOException, InternalServerErrorException, DataAccessException { public static void configure() throws IOException, InternalServerErrorException, DataAccessException {
@ -97,9 +98,9 @@ public class ConfigureDb {
ConfigBaseVariable.dbPort = "3906"; ConfigBaseVariable.dbPort = "3906";
ConfigBaseVariable.dbUser = "root"; ConfigBaseVariable.dbUser = "root";
} }
removeDB();
// Connect the dataBase... // Connect the dataBase...
da = DBAccess.createInterface(); da = DBAccess.createInterface();
removeDB();
} }
public static void removeDB() { public static void removeDB() {
@ -113,14 +114,35 @@ public class ConfigureDb {
if (modeTestForced != null) { if (modeTestForced != null) {
modeTest = modeTestForced; modeTest = modeTestForced;
} }
DbConfig config = null;
try {
config = new DbConfig();
} catch (final DataAccessException e) {
e.printStackTrace();
LOGGER.error("Fail to clean the DB");
return;
}
config.setDbName(null);
LOGGER.info("Remove the DB and create a new one '{}'", config.getDbName());
try (final DBAccess daRoot = DBAccess.createInterface(config)) {
if ("SQLITE-MEMORY".equalsIgnoreCase(modeTest)) { if ("SQLITE-MEMORY".equalsIgnoreCase(modeTest)) {
// nothing to do ... // nothing to do ...
} else if ("SQLITE".equalsIgnoreCase(modeTest)) { } else if ("SQLITE".equalsIgnoreCase(modeTest)) {
da.deleteDB(ConfigBaseVariable.bdDatabase); daRoot.deleteDB(ConfigBaseVariable.bdDatabase);
} else if ("MY-SQL".equalsIgnoreCase(modeTest)) { } else if ("MY-SQL".equalsIgnoreCase(modeTest)) {
da.deleteDB(ConfigBaseVariable.bdDatabase); daRoot.deleteDB(ConfigBaseVariable.bdDatabase);
} else if ("MONGO".equalsIgnoreCase(modeTest)) { } else if ("MONGO".equalsIgnoreCase(modeTest)) {
da.deleteDB(ConfigBaseVariable.bdDatabase); daRoot.deleteDB(ConfigBaseVariable.bdDatabase);
}
daRoot.createDB(ConfigBaseVariable.bdDatabase);
} catch (final InternalServerErrorException e) {
e.printStackTrace();
LOGGER.error("Fail to clean the DB");
return;
} catch (final IOException e) {
e.printStackTrace();
LOGGER.error("Fail to clean the DB");
return;
} }
} }

View File

@ -95,7 +95,7 @@ public class TestRawQuery {
{ {
final String query = """ final String query = """
SELECT DISTINCT intData SELECT id, intData
FROM TypesTable FROM TypesTable
WHERE `intData` = ? WHERE `intData` = ?
ORDER BY id DESC ORDER BY id DESC
@ -105,7 +105,7 @@ public class TestRawQuery {
final List<TypesTable> retrieve = daSQL.query(TypesTable.class, query, parameters); final List<TypesTable> retrieve = daSQL.query(TypesTable.class, query, parameters);
Assertions.assertNotNull(retrieve); Assertions.assertNotNull(retrieve);
Assertions.assertEquals(1, retrieve.size()); Assertions.assertEquals(3, retrieve.size());
Assertions.assertEquals(99, retrieve.get(0).intData); Assertions.assertEquals(99, retrieve.get(0).intData);
} }
} else { } else {

View File

@ -3,9 +3,11 @@ package test.kar.archidata.dataAccess.model;
import org.kar.archidata.model.GenericData; import org.kar.archidata.model.GenericData;
import dev.morphia.annotations.Entity; import dev.morphia.annotations.Entity;
import jakarta.persistence.Column;
@Entity @Entity
public class SimpleTable extends GenericData { public class SimpleTable extends GenericData {
@Column(length = 0)
public String data; public String data;
} }

View File

@ -3,8 +3,10 @@ package test.kar.archidata.dataAccess.model;
import org.kar.archidata.model.GenericDataSoftDelete; import org.kar.archidata.model.GenericDataSoftDelete;
import dev.morphia.annotations.Entity; import dev.morphia.annotations.Entity;
import jakarta.persistence.Column;
@Entity @Entity
public class SimpleTableSoftDelete extends GenericDataSoftDelete { public class SimpleTableSoftDelete extends GenericDataSoftDelete {
@Column(length = 0)
public String data; public String data;
} }