Jmix version: 1.3.1
Jmix Studio plugin version: 1.3.3-213
IntelliJ IDEA 2022.1.4 (Community Edition)
Build #IC-221.6008.13, built on July 19, 2022
Runtime version: 11.0.15+10-b2043.56 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Kotlin: 221-1.7.10-release-333-IJ5591.52
Java Version: java 17.0.4 2022-07-19 LTS
Java™ SE Runtime Environment (build 17.0.4+11-LTS-179)
Java HotSpot™ 64-Bit Server VM (build 17.0.4+11-LTS-179, mixed mode, sharing)
Operating System: macOS 12.4 (21F79)
File System: Case-Sensitive Journaled HFS+ (APFS)
Datebase: PostgreSQL 13
Hello Everyone
For your information, I have the following problem with Jmix Studio.
In the “Handling Unique Constraint Violation Exceptions” documentation
https://docs.jmix.io/jmix/ui/exception-handlers/unique-constraint-violation-exception.html
it says that I may choose a name for my DB constraints and that it should be prefixed with databaseUniqueConstraintViolation.
However, when I try to enter my own name in the Studio “Indexes” view, e.g. for my User entity, Studio enforces a name of the form IDX_xyz_USER_UNQ and only allows me to append text to this. So for example, I may write IDX_NF_USER_UNQ_USERNAME but cannot modify the text before “_USERNAME”.
@JmixEntity
@Entity(name = “sec$User”)
@Table(name = “SEC_USER”, indexes = {
@Index(name = “IDX_NF_USER_UNQ_USERNAME”, columnList = “USERNAME”, unique = true)
}, uniqueConstraints = {
@UniqueConstraint(name = “IDX_NF_USER_UNQ_EMAIL”, columnNames = {“EMAIL”})
})
public class User implements JmixUserDetails, HasTimeZone {
But at runtime Jmix wants the following property:
databaseUniqueConstraintViolation.IDX_SEC_USER_ON_USERNAME
If I have the following in my messages_en.properties file:
databaseUniqueConstraintViolation.IDX_NF_USER_UNQ_USERNAME=ERROR: A user with the same username already exists
then I receive the following message at runtime:
Unique constraint violation occurred (IDX_SEC_USER_ON_USERNAME)
I have modified my naming as a temporary workaround to receive my message but can you please correct this. Thanks in advance for your support.
Best regards
Chris