public class UniquePropertyEntityConverter extends Object implements PropertyConverter<Object>
EntityRegistration
to resolve entities by a specific unique property.
If an entity has exactly one unique property, one can use DefaultEntityConverter
instead.
If an entity has no unique property or some other kind of key is used as reference in the CSV files, one can use
MapConverter
.Modifier and Type | Field and Description |
---|---|
private EntityRegistration |
entityRegistration
Used to find the entities.
|
private String |
uniqueProperty
The name of the unique properties.
|
Constructor and Description |
---|
UniquePropertyEntityConverter(EntityRegistration entityRegistration,
String uniqueProperty) |
Modifier and Type | Method and Description |
---|---|
Object |
convert(Class<? extends Object> targetType,
String value)
Converts a value from import file to Java.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
of
private final EntityRegistration entityRegistration
private final String uniqueProperty
@ConstructorProperties(value={"entityRegistration","uniqueProperty"}) @Generated(value="lombok") public UniquePropertyEntityConverter(EntityRegistration entityRegistration, String uniqueProperty)
public Object convert(Class<? extends Object> targetType, String value)
PropertyConverter
convert
in interface PropertyConverter<Object>
targetType
- the type of the target propertyvalue
- the value in the import fileCopyright © 2022 fastnate.org. All rights reserved.