Implement this interface when implementing special custom Aliases for classes, packages or namespaces.
For a list of all members of this type, see Alias Members.
Type | Description |
---|---|
TypeAlias | a simple Alias for a single Class or Type, using #equals() on the names in the resolve method. |
WildcardAlias | Wildcard Alias functionality to create aliases for packages, namespaces or multiple similar named classes. |
Implement this interface when implementing special custom Aliases for classes, packages or namespaces.
Aliases can be used to persist classes in the running application to different persistent classes in a database file or on a db4o server.
Two simple Alias implementations are supplied along with db4o:
- com.db4o.config.TypeAlias provides an #equals() resolver to match names directly.
- com.db4o.config.WildcardAlias allows simple pattern matching with one single '*' wildcard character.
It is possible to create own complex com.db4o.config.Alias constructs by creating own resolvers that implement the com.db4o.config.Alias interface.
Four examples of concrete usecases:
// Creating an Alias for a single class
Db4o.configure().addAlias(
new TypeAlias("com.f1.Pilot", "com.f1.Driver"));
// Accessing a .NET assembly from a Java package
Db4o.configure().addAlias(
new WildcardAlias(
"com.f1.*, F1RaceAssembly",
"com.f1.*"));
// Using a different local .NET assembly
Db4o.configure().addAlias(
new WildcardAlias(
"com.f1.*, F1RaceAssembly",
"com.f1.*, RaceClient"));
// Mapping a Java package onto another
Db4o.configure().addAlias(
new WildcardAlias(
"com.f1.*",
"com.f1.client*"));
Namespace: com.db4o.config
Assembly: db4o (in db4o.dll)
Alias Members | com.db4o.config Namespace