public class ValueGenerationManagerImpl extends Object implements ValueGenerationManager
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,ValueGenerator> |
generatorsByMemberKey
Map of ValueGenerators, keyed by the member key ("{class}.{field}", or "{class} + (datastore-id)").
|
protected StoreManager |
storeMgr |
protected Map<String,ValueGenerator> |
uniqueGeneratorsByName
Map of "unique" ValueGenerators, keyed by their strategy name.
|
| Constructor and Description |
|---|
ValueGenerationManagerImpl(StoreManager storeMgr)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Method to clear out the generators managed by this manager.
|
ValueGenerator |
createAndRegisterValueGenerator(String memberKey,
String strategyName,
Properties props)
Method to create and register a generator of the specified strategy, for the specified memberKey.
|
ValueGenerator |
createValueGenerator(String strategyName,
String seqName,
Properties props,
ValueGenerationConnectionProvider connectionProvider)
Method to create a ValueGenerator when the generator is datastore based.
|
String |
getMemberKey(AbstractClassMetaData cmd,
int fieldNumber)
Simple way of generating a member "key" for use in lookups.
|
Class |
getTypeForValueGeneratorForMember(String strategyName,
String memberKey)
Accessor for the type of value that is generated by the ValueGenerator for the specified strategy, for the member "key".
|
ValueGenerator |
getUniqueValueGeneratorByName(String name)
Accessor for the "unique" ValueGenerator for the specified name (if any).
|
ValueGenerator |
getValueGeneratorForMemberKey(String memberKey)
Method to access the currently defined ValueGenerator for the specified member "key" (if any).
|
void |
registerValueGeneratorForMemberKey(String memberKey,
ValueGenerator generator)
Method to store a ValueGenerator for the specified member "key".
|
boolean |
supportsStrategy(String strategy)
Convenience accessor for whether the specified strategy is supported for this datastore.
|
protected final StoreManager storeMgr
protected Map<String,ValueGenerator> generatorsByMemberKey
protected Map<String,ValueGenerator> uniqueGeneratorsByName
public ValueGenerationManagerImpl(StoreManager storeMgr)
storeMgr - Store Managerpublic void clear()
ValueGenerationManagerclear in interface ValueGenerationManagerpublic ValueGenerator getValueGeneratorForMemberKey(String memberKey)
ValueGenerationManagergetValueGeneratorForMemberKey in interface ValueGenerationManagermemberKey - The member "key"public void registerValueGeneratorForMemberKey(String memberKey, ValueGenerator generator)
ValueGenerationManagerregisterValueGeneratorForMemberKey in interface ValueGenerationManagermemberKey - The member "key"generator - The ValueGenerator to use for that member keypublic ValueGenerator getUniqueValueGeneratorByName(String name)
ValueGenerationManagergetUniqueValueGeneratorByName in interface ValueGenerationManagername - The (strategy) name.public String getMemberKey(AbstractClassMetaData cmd, int fieldNumber)
ValueGenerationManagergetMemberKey in interface ValueGenerationManagercmd - Metadata for the classfieldNumber - The field number (absolute). -1 if datastore-id surrogate member.public Class getTypeForValueGeneratorForMember(String strategyName, String memberKey)
ValueGenerationManagergetTypeForValueGeneratorForMember in interface ValueGenerationManagerstrategyName - The value generation strategymemberKey - The member "key"public ValueGenerator createAndRegisterValueGenerator(String memberKey, String strategyName, Properties props)
ValueGenerationManagercreateAndRegisterValueGenerator in interface ValueGenerationManagermemberKey - The member keystrategyName - Strategy for the generatorprops - The properties to usepublic boolean supportsStrategy(String strategy)
ValueGenerationManagersupportsStrategy in interface ValueGenerationManagerstrategy - The strategy namepublic ValueGenerator createValueGenerator(String strategyName, String seqName, Properties props, ValueGenerationConnectionProvider connectionProvider)
ValueGenerationManagercreateValueGenerator in interface ValueGenerationManagerstrategyName - Strategy nameseqName - Symbolic name of the generatorprops - Properties to control the generatorconnectionProvider - Provider for connectionsCopyright © 2019. All rights reserved.