JPA uniqueConstraints without name makes Studio crash

Hi,

On Studio 7 Beta 2 the Indexes tab is gone, so I try to do manually:

@Table(name = "MY_AWESOME_TABLE",
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"SERIE", "NUMERO"})
        })

Notice I forgot to put a name on the constraint, the parameter is NOT required and has a default of “” (blank string).

If you then switch to the DDL preview the plugin will crash:

java.lang.IllegalStateException: Name for an index is empty. Check entity: 

expected behaviour: If CUBA really wants a name on the index it should properly complain somehow
current behaviour: plugin crash

BTW: Where is the proper place to file bugreports? Github? Youtrack? Here?

Hi Marc,

Thank you for this bug report - we’ll look into it.
Please keep posting such reports here with the beta tag. YouTrack is our main bugtracker for Studio, but it’s read-only for the public.

1 Like

Thank you for reporting the problem. We have created a YouTrack issue.

1 Like

Hi evryone, what about this issue? It seems not resolved. I have de same problem when generate db script.

An error occurred while generating DB scripts.
Name for an index is empty. Check entity:

How can i solve it?

My Studio version is: CUBA Studio 2018.3 (plugin v9.1-183)

Thanks for answering

Hi.
You can set the name of the index manually. Open the Entity code and define the name attribute for your index.

In the new version of Studio (Studio 10) we implemented visual designer for entity indexes and unique constraints. See the Indexes tab at the bottom of the entity editor.

1 Like