JPA Validation WIP

This commit is contained in:
Francesco
2023-10-11 10:53:40 +02:00
parent 4b21437c30
commit 2fb76d445f
9 changed files with 111 additions and 43 deletions

View File

@@ -31,6 +31,7 @@
<form class="form" enctype="multipart/form-data" method="post" th:action="|/${dbadmin_baseUrl}/model/${className}/create|">
<input type="hidden" name="__dbadmin_create" th:value="${create}">
<div th:each="field : ${schema.getSortedFields(false)}" class="mt-2"
th:if="${!field.isGeneratedValue() || !create}"
th:classAppend="|${validationErrors != null && validationErrors.hasErrors(field.getJavaName()) ? 'invalid' : ''}|">
<label th:for="|__id_${field.getName()}|" class="mb-1 fw-bold">
<span th:if="${!field.isNullable() && !field.isPrimaryKey()}">

View File

@@ -68,7 +68,7 @@
<td>
<i class="bi bi-cpu"></i>
</td>
<td th:text="${colName}">
<td class="fw-bold" th:text="${colName}">
</td>
<td th:text="${object.compute(colName)}">
</td>