public class ERXJDBCMigrationLock extends Object implements IERXMigrationLock
Name | Description |
---|---|
er.migration.JDBC.dbUpdaterTableName | the name of the db update version table (defaults to _DBUpdater) |
er.migration.createTablesIfNecessary | if true, the tables and model rows will be created automatically. *ONLY SET THIS IF YOU ARE RUNNING IN DEVELOPMENT MODE OR WITH A SINGLE INSTANCE*. If you are running multiple instances, the instances will not be able to acquire locks properly and you may end up with multiple instances attempting to create lock tables and/or failing to startup properly. |
<ModelName>.InitialMigrationVersion | the starting version number (in case you are retrofitting a project with migrations) |
Constructor and Description |
---|
ERXJDBCMigrationLock() |
Modifier and Type | Method and Description |
---|---|
boolean |
_tryLock(com.webobjects.eoaccess.EOAdaptorChannel channel,
com.webobjects.eoaccess.EOModel model,
String lockOwnerName,
boolean createTableIfMissing) |
protected boolean |
createIfMissing() |
protected String |
dbUpdaterCreateStatement(com.webobjects.eoaccess.EOModel model,
com.webobjects.jdbcadaptor.JDBCAdaptor adaptor) |
protected com.webobjects.eoaccess.EOModel |
dbUpdaterModelWithModel(com.webobjects.eoaccess.EOModel model,
com.webobjects.jdbcadaptor.JDBCAdaptor adaptor) |
protected int |
initialVersionForModel(com.webobjects.eoaccess.EOModel model) |
protected String |
migrationTableName(com.webobjects.jdbcadaptor.JDBCAdaptor adaptor)
Adds support for overriding the name of the db updater table on a per-database product level.
|
void |
setVersionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel,
com.webobjects.eoaccess.EOModel model,
int versionNumber)
Sets the current version number of the named model.
|
boolean |
tryLock(com.webobjects.eoaccess.EOAdaptorChannel channel,
com.webobjects.eoaccess.EOModel model,
String lockOwnerName)
Attempts to retrieve a lock on the migration process for the named model.
|
void |
unlock(com.webobjects.eoaccess.EOAdaptorChannel channel,
com.webobjects.eoaccess.EOModel model)
Unlocks the given model.
|
int |
versionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel,
com.webobjects.eoaccess.EOModel model)
Returns the current version number of the named model.
|
protected String migrationTableName(com.webobjects.jdbcadaptor.JDBCAdaptor adaptor)
adaptor
- the current jdbc adaptorprotected boolean createIfMissing()
public boolean tryLock(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOModel model, String lockOwnerName)
IERXMigrationLock
tryLock
in interface IERXMigrationLock
channel
- the adaptor channel associated with this processmodel
- the model to try to locklockOwnerName
- the name of the lock ownerpublic boolean _tryLock(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOModel model, String lockOwnerName, boolean createTableIfMissing)
public void unlock(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOModel model)
IERXMigrationLock
unlock
in interface IERXMigrationLock
channel
- the adaptor channel associated with this processmodel
- the model to unlockpublic int versionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOModel model)
IERXMigrationLock
versionNumber
in interface IERXMigrationLock
channel
- the adaptor channel associated with this processmodel
- the model to lookup version information onpublic void setVersionNumber(com.webobjects.eoaccess.EOAdaptorChannel channel, com.webobjects.eoaccess.EOModel model, int versionNumber)
IERXMigrationLock
setVersionNumber
in interface IERXMigrationLock
channel
- the adaptor channel associated with this processmodel
- the model to set version information onversionNumber
- the new version numberprotected int initialVersionForModel(com.webobjects.eoaccess.EOModel model)
protected com.webobjects.eoaccess.EOModel dbUpdaterModelWithModel(com.webobjects.eoaccess.EOModel model, com.webobjects.jdbcadaptor.JDBCAdaptor adaptor)
protected String dbUpdaterCreateStatement(com.webobjects.eoaccess.EOModel model, com.webobjects.jdbcadaptor.JDBCAdaptor adaptor)
Copyright © 2002 – 2020 Project Wonder.