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
Post a Comment