java - Using @Entity Class When Table Doesn't Exist -


i have several database tables spring mvc/jpa application refers using @entity , @table annotations. i've run issue if application switches between database connections, tables exist on database 1 may not exist in database 2 (as following sdlc cycle , promoting table additions/changes after "ok"), resulting in sql exception when application server starts.

does spring offer way mark specific @entity classes "optional" or "transactional" there no database exceptions returned because of nonexistant tables?

in opinion, there no option that.

you can add automatic update of schema in hibernate, mentioned doing manually.

hibernate validating schema, when establishes connection. use @entity, looks table , throws error if there no name specified.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -