public class StringConverter extends Object implements ValueConverter<String>
EntityClass
.Modifier and Type | Field and Description |
---|---|
private String |
attributeName |
private static int |
DEFAULT_COLUMN_LENGTH |
private int |
maxSize |
private int |
minSize |
private boolean |
nullable |
Constructor and Description |
---|
StringConverter()
Creates a new instance of a StringConverter that accepts strings of arbitrary length.
|
StringConverter(AttributeAccessor attribute,
boolean mapKey)
Creates a new instance of a StringConverter for the given attribute.
|
StringConverter(javax.persistence.Column column,
boolean nullable)
Creates a new instance of a StringConverter for the given column definition.
|
Modifier and Type | Method and Description |
---|---|
ColumnExpression |
getExpression(String value,
GeneratorContext context)
Builds the expression for writing the default value into an SQL clause.
|
private static final int DEFAULT_COLUMN_LENGTH
private final int maxSize
private final int minSize
private boolean nullable
private final String attributeName
public StringConverter()
public StringConverter(AttributeAccessor attribute, boolean mapKey)
attribute
- the attribute to convertmapKey
- indicates that the converter is used for the key of a map propertypublic StringConverter(javax.persistence.Column column, boolean nullable)
column
- contains the optional definition, the converter uses the defaults if the column is null
nullable
- indicates that the column may be null
according to other settings (may be overridden by the
column definition)public ColumnExpression getExpression(String value, GeneratorContext context)
ValueConverter
getExpression
in interface ValueConverter<String>
value
- the default value, as given in an DefaultValue
expressioncontext
- the current context (contains the database dialect).Copyright © 2022 fastnate.org. All rights reserved.