Beans/frank.
I should probably add a test for this. Ha!
This commit is contained in:
@@ -267,7 +267,7 @@ public class PersistenceContext
|
|||||||
Class<T> type, SchemaMigration migration)
|
Class<T> type, SchemaMigration migration)
|
||||||
{
|
{
|
||||||
DepotMarshaller<T> marshaller = getRawMarshaller(type);
|
DepotMarshaller<T> marshaller = getRawMarshaller(type);
|
||||||
marshaller.requireInitialized(
|
marshaller.requireNotInitialized(
|
||||||
"Migrations must be registered before initializeRepositories() is called.");
|
"Migrations must be registered before initializeRepositories() is called.");
|
||||||
marshaller.registerMigration(migration);
|
marshaller.registerMigration(migration);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -456,10 +456,11 @@ public class DepotMarshaller<T extends PersistentRecord> implements QueryMarshal
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws {@link IllegalStateException} with {@code msg} if this marshaller is not initialized.
|
* Throws {@link IllegalStateException} with {@code msg} if this marshaller is already
|
||||||
|
* initialized.
|
||||||
*/
|
*/
|
||||||
public synchronized void requireInitialized (String msg) {
|
public synchronized void requireNotInitialized (String msg) {
|
||||||
if (_meta == null) throw new IllegalStateException(msg);
|
if (_meta != null) throw new IllegalStateException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user