Constraint « Schema « JPA Q&A

1. ORM: where to specify database constraints if db schema is maintained manually

I see 3 variants:

  1. specify db constraints in schema (*.sql) file
  2. specify db constraints in ORM stuff(with xml/annotations/whatever)
  3. use mix of 1) and 2)
Is there any Best Practice for this topic? Particularly, I'm interested in ...

2. SchemaExport did not successfully create fk constraints

Hi, I am currently upgrading my sample project, which was created 3 years ago, to latest version of frameworks, such as Hibernate, Jboss Cache, and Spring. The issue I am encountering is the SchemaExport did not create foreign key constraints into Mysql when I am deploying the application on Ubuntu. I remembered it was generated successfully when I worked on Windows ...

3. Specify constraint names for SchemaExport

Hibernate version: 2.1.2 Underlying Database: MS Sql Server I am wanting to know if there is any way to name the constraints, specified by the unique and unique-key attributes in the mapping file, when using the ExportSchema task. We are wanting to use the ExportSchema task to create an initial database schema, however the use of default constraint names may cause ...