I am trying to integrate CUBA Platform with Sybase IQ (SQL Anywhere), so far I’ve configure d EclipseLink to work with it, but I’m not sure how to make Entities visible in CUBA platform DATA/Generic UI/Generate model sections. (I guess the message files have menu metadata, but is it possible to automatically generate it for custom db?)
Let me quote my answer about possibility of Firebird integration:
> First of all, let’s distinguish the platform itself as a runtime framework from Studio as a design-time tool. On one hand, the platform can work with any DBMS supported by EclipseLink ORM, and the documentation explains how to set up your project for an arbitrary DBMS. On the other hand, Studio works only with a limited number of databases because it must know their specifics to generate correct DDL scripts.
So there is no way of working with unsupported databases in Studio.
Could you explain your intention in more detail? Do you want to use Sybase IQ as a main database or just need to integrate with an existing storage?
Hi Konstantin,
Thank you for an answer, In our case we are investigating the possibility of migrating legacy application front-end to CUBA Platform. The main usecase is having Sybase IQ as a secondary DataStore, generating model in CUBA Studio for existing Sybase IQ tables and adding webforms for them, that’s it. The possibility to modify schema (create/modify tables) is optional but would be very useful as well.
From what I’ve read in your linked thread, if I understand correctly, it is not possible to use design-time Studio capablities with unsupported databases, unless DDL scripts are generated manually, could you possibly explain a bit or link some information about how to integrate manually written scripts with CUBA? What scripts need to be written, where they should be stored etc.
Regards
I think your requirements are feasible, but yes, you will have to create your entities from scratch (model generation in Studio won’t work), and write update scripts in the future also by hand.
From what you have asked I conclude that the model is expected to be the origin of changes in the future. I.e. the new app will drive the database changes, and if other apps are using the database as well they will adapt. In this case you will probably want to run update scripts on the app server startup as it is done for the main database with the cuba.automaticDatabaseUpdate property. It’s not supported for additional data stores yet (regardless of the database type), but can be done by creating your own modification of the DbUpdaterImpl bean. Let me know if you need an example.
is there really no way to generate model from Studio? Model generation from studio is a must for us, there are too many entities to create by hand, I thought it would work with minor additions like type converter implementation or something of the sort, since there are no database schema modifications, just entity generation. Can you confirm that there is no way to generate entities from Sybase IQ with CUBA Studio at this time?
Regarding database changes, I will try using DbUpdaterImpl approach and create another thread if I run into problems, thanks.
There is no way even to connect Studio to a database unless it fits to one of predefined JDBC drivers and connection URL formats. It’s all hardcoded now.
Meanwhile, I think you can try the following approach: save your database schema as DDL statements and adapt it by search/replace to the format suitable for one of the databases supported by Studio (SQLServer, Postgres, etc.). Then create this database, connect by Studio and generate model from it. Of course, it makes sense if you have already managed to work with Sybase IQ from CUBA in runtime.