Cuba Studio 7.2 generates bad sql scripts

Hi,

I created simple entity with two properties: code and name.

 public class Country extends BaseUuidEntity implements Updatable, Creatable {
     @NotNull
     @Column(name = "CODE", nullable = false, unique = true, length = 2)
     protected java.lang.String code;
 
     @NotNull
     @Column(name = "NAME", nullable = false, unique = true)
     protected java.lang.String name;
 
    ...
 }

Studio generated sql scripts for mssql like this:

INIT:

create table APP_COUNTRY (
    primary key nonclustered (ID)
)^

create unique index IDX_APP_COUNTRY_UNIQ_NAME on APP_COUNTRY (NAME) ^
create unique index IDX_APP_COUNTRY_UNIQ_CODE on APP_COUNTRY (CODE) ^

UPDATE:

create table APP_COUNTRY (
    primary key nonclustered (ID)
);

create unique index IDX_APP_COUNTRY_UNIQ_NAME on APP_COUNTRY (NAME);
create unique index IDX_APP_COUNTRY_UNIQ_CODE on APP_COUNTRY (CODE);

First problem:
Studio not genereted columns for properties: code and name in sql scripts

Second problem:
updateDb throws exception: Incorrect syntax near ‘)’. on sql query:

create table APP_COUNTRY (
      primary key nonclustered (ID)
);

Regards
Marcin

Hi.
Which version of the mssql do you use?
If it is possible, could you share the small project in order to help us investigate the problem?

Hi,

My mssql version: 14.0.2002.14

This happend not only on mssql database.

On HSQLDB - DLL preview:

create table APP_DICTIONARY (
    primary key (ID)
)^

-- unique indexes

create unique index IDX_APP_DICTIONARY_UNIQ_CODE on APP_DICTIONARY (CODE) ^
create unique index IDX_APP_DICTIONARY_UNIQ_NAME on APP_DICTIONARY (NAME) ^

Regards
Marcin

app.zip (70,1 KB)

Hi,
I found the reason. I had old files (from the beta version) in the folder USER / .CubaStudio2018.3.
After removing this folder, everything is fine.

Regards
Marcin

2 Likes