Sybase ASE 15.5 and which JPA implementation? - jpa

Which JPA implementation supports the following features against Sybase ASE 15.5 and how well?
Schema import (there is an existing server running; Hibernate does not even find existing tables.)
Schema export (maybe for new stuff; Hibernate seems to have no support for UNIVARCHAR)
stored procedure support
stored procedure import? (like schema import)
UNIVARCHAR type support (Hibernate does not per-se generate UNIVARCHAR columns, how about OpenJPA?)
TEXT type support.
schema migration including data migration tools
Any other pros/cons?

JPA is a runtime, not a development tool. Most of your questions seem to be tooling related, for which I would suggest using Eclipse JPA (Dali).
You can use any schema tools you want with any JPA provider, as long as they generate standard JPA metadata.
EclipseLink supports calling stored procedures on Sybase, including output parameters and multiple resultsets.
Any JPA provider should work at runtime with UNIVARCHAR and TEXT, to have the type used in default schema generation you would set them in the #Column columnDefinition, or customize the SybasePlatform in EclipseLink to use the type by default.

Related

Is there a way for implementing database migrations on Spring JPA without the use of frameworks (e.g.: flyway, liquidbase, etc)?

I'm migrating a system that used to be written in Jdbc Templates to Spring Data JPA. Before, we used to write the SQL queries ourselves, but now that we're modernizing our system, we're going to use Spring Data JPA for this. Due to restrictive factors, i can't implement a database migration framework, such as flyway and liquidbase. Is there any way i can implement those using what i have on Spring JPA?

Liquibase from JPA classes, no database yet

We have started our application by our model classes, annotated with JPA annotations. We did not create any tables in the database yet.
Now, we would like to somehow generate a liquibase changelog by only looking at the JPA classes, maybe at file persistence.xml.
Most of the questions and answers about liquibase in SO suggest to run liquibase and compare it with the current state of the database. But that's not our case, because our database does not have any of the tables corresponding to the JPA entities, nor any of the liquibase control tables.
How do I generate a liquibase changelog file from the JPA entities?
you can take a look on liquibase-hibernate plugin https://github.com/liquibase/liquibase-hibernate/wiki
you can make a diff between your JPA entities against an empty database , and this will generate the whole changelog of the JPA entities..

Configure JaVers to create tables in a particular schema

When using JaVers, JaVers is creating its 4 tables in the public schema in Postgres (http://javers.org/documentation/repository-configuration/#connection-provider). I would like to configure it to save these tables in a new schema, example, AuditSchema. Is this possible to configure?
It's available now. Just set property javers.sqlSchema=AuditSchema
No, there is no such feature, see https://github.com/javers/javers/blob/0e21d83ada5678eb9b396606dd6bc926ddf87b23/javers-persistence-sql/src/main/java/org/javers/repository/sql/schema/FixedSchemaFactory.java
It might be a good candidate for contribution to JaVers but all supported SQL dialects should be concerned (MySql, Postgres, MS SQL, H2, Oracle)

How to generate table definitions using JPA Tools with Eclipselink 2.5

I tried to set-up tables in a MySql database with MySql Workbench including foreign keys, unique indexes, cascades on update/delete, ...
Then I let Eclipselink 2.5.1 create entities from tables with Project --> JPA Tools... in Eclipse. My hope was to see how I have to annotate classes, fields, methods to get the same result if I define the objects and run JPA Tools the other way around (Create Tables from Entities...).
Unfortunately I can't see anything of the previously defined cascading options or indexes in the created Java classes. Is there a way to make this way work?
For instance, I want to know how I can define the cascading option for update a I can do with #CascadeOnDelete (in MySql On Update stays 'RESTRICT')...or to find out why
#Table(name="geolocations",
uniqueConstraints=#UniqueConstraint(columnNames={"latitude", "longitude"}))
does not result in an index creation in the MySql table after running JPA Tools --> Create Tables form Entities...

Db schema is complete, can Entity Framework generate Storage Schema?

If I already have a database schema complete, can the entity framework somehow generate the storage schema for me?
Or if I have the classes developed, can it generate the other xml's desribing the classes and their relationships?
Most can yes... I believe what you would be looking for is hibernate tools (tools.hibernate.com). Toplink and other frameworks should have equivalent functionality. You essentially provide login/db provider information, and it queries the catalog and generates xml and classes