Hi, I created 6 entities from a Ms-Sql Server 2016 legacy database with the generate model capability (Cuba Studio 6.7.5).
One of them has a composite key:
public class ContracteLinia extends BaseGenericIdEntity {
private static final long serialVersionUID = -176686131685616900L;
@Column(name = "\"AgDuCd\"")
protected Integer agDuCd;
......
@EmbeddedId
protected Contrac1CompKey id;
Cuba Studio created the Persistent embedded entity for the composite key correctly:
public class Contrac1CompKey extends EmbeddableEntity {
private static final long serialVersionUID = -479350421485618543L;
@Column(name = "\"CteCd\"", nullable = false)
protected Integer cteCd;
@Column(name = "\"CteLnCd\"", nullable = false)
protected Integer cteLnCd;
Then, I created a new entity from scratch in Cuba Studio with a many to one association to
the entity with composite key. Here it is the code generated by Cuba Studio:
@JoinColumns({
@JoinColumn(name = “CONTRACTE_LINIA_“CTECD””, referencedColumnName = ““CTECD””),
@JoinColumn(name = “CONTRACTE_LINIA_“CTELNCD””, referencedColumnName = ““CTELNCD””)
})
@ManyToOne(fetch = FetchType.LAZY, optional = false)
protected ContracteLinia contracteLinia;
The problem appears executing the DB generation scripts, created by Cuba Studio, showing the following error:
Task ‘updateDb’ failed
com.microsoft.sqlserver.jdbc.SQLServerException: Sintaxis incorrecta cerca de ‘’
The script with the problem, generated by Cuba Studio, is:
alter table PROEXSAFENIX_FACTURA_PROVEIDOR_LIN add constraint FK_PROEXSAFENIX_FACTURA_PROVEIDOR_LIN_COLI"COLI" foreign key (CONTRACTE_LINIA_“CTECD”, CONTRACTE_LINIA_“CTELNCD”) references CONTRAC1(“CteCd”, “CteLnCd”);
Is there someone who found the same problem and could give me a solution?
Thansk in advance.