Hi.
I tried to make a composite key following this example. The only difference between the example and my implementation is that I use an association with another entity’s id.
To be specific, I have an entity called Building with String id and then I have a Floor entity with composite id (FloorPK). The composite id contains an association many-to-one with Building and a String for the floor id.
I also have an entity called Room which has a composite key made up of one Floor association and a String id.
When I try to generate the database scripts I get an exception:
[12:54:08.254] Exception has been thrown by com.haulmont.studio.ui.app.c@34a2beee:
[12:54:08.255] java.lang.RuntimeException: Cannot map to SQL type:Floor [maintapp$Floor]
at com.haulmont.studio.backend.ed.ddl.F.getMappedType(SourceFile:151)
at com.haulmont.studio.backend.ed.ddl.D.getMappedType(SourceFile:47)
at com.haulmont.studio.backend.ed.ddl.a.generateAlterColumn(SourceFile:1889)
at com.haulmont.studio.backend.ed.ddl.T.a(SourceFile:838)
at com.haulmont.studio.backend.ed.ddl.T.a(SourceFile:493)
at com.haulmont.studio.backend.ed.ddl.T.a(SourceFile:177)
at com.haulmont.studio.backend.ed.ddl.a.generateTableUpdates(SourceFile:514)
at com.haulmont.studio.backend.ed.ddl.a.generateUpdates(SourceFile:503)
at com.haulmont.studio.ui.d.H.c(SourceFile:135)
at com.haulmont.studio.ui.d.H.b(SourceFile:109)
at com.haulmont.studio.ui.d.J.buttonClick(SourceFile:190)
at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:200)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:163)
at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1037)
at com.vaadin.ui.Button.fireClick(Button.java:377)
...
[12:54:08.260] Unexpected error
java.lang.RuntimeException: Cannot map to SQL type:Floor [maintapp$Floor]
I should also point out that whenever I try to see the DDL preview of Room entity in Cuba Studio it throws a NullPointerException.
Other info:
Studio version 6.8.2
Platform version 6.8.3
OS Windows 7