public class TypeMappingBuilder
extends java.lang.Object
Constructor and Description |
---|
TypeMappingBuilder() |
Modifier and Type | Method and Description |
---|---|
TypeMappingBuilder |
add(Type type,
java.lang.String name)
Adds a mapping for the specified type.
|
static TypeMappingBuilder |
basicBuilder()
Obtains the basic builder for mappings.
|
TypeMapping |
build()
Creates
TypeMapping from the builder. |
public static TypeMappingBuilder basicBuilder()
All the types are mapped in the builder as follows:
Type.BYTE_ARRAY
- BLOB
Type.INT
- INT
Type.LONG
- BIGINT
Type.STRING_255
- VARCHAR(255)
Type.STRING
- TEXT
Type.BOOLEAN
- BOOLEAN
If the mapping provided by the builder doesn't match a database, it can be overridden as follows:
TypeMapping mapping = basicBuilder().add(Type.INT, "INT4")
.add(Type.LONG, "INT8")
.build();
public TypeMappingBuilder add(Type type, java.lang.String name)
Overrides the name of the type if it is already specified.
type
- the type for the mappingname
- the custom name for the typepublic TypeMapping build()
TypeMapping
from the builder.java.lang.IllegalStateException
- if not all the types were mapped