public class PropertyIdMethod extends Object implements IdMethod
Modifier and Type | Field and Description |
---|---|
static PropertyIdMethod |
BARCODE
Use the barcode for finding items.
|
private String |
columnMappingParameterName |
static PropertyIdMethod |
EXTERNAL_ID
Use the external ID for finding items.
|
private String |
method |
static PropertyIdMethod |
NAME
Use the name for finding items.
|
private String |
property |
private String |
title |
private boolean |
unique |
private Type |
valueType |
Constructor and Description |
---|
PropertyIdMethod(String method,
String title,
String property,
String columnMappingParameterName,
boolean unique,
Type valueType)
Create a new id method.
|
Modifier and Type | Method and Description |
---|---|
<I extends BasicItem> |
find(DbControl dc,
ItemQuery<I> query,
String identifier)
Find all items with
property = identifier . |
String |
getColumnMappingParameterName() |
String |
getMethod()
The name of this method, which should be unique among the methods that
can be used at a given time.
|
String |
getProperty() |
String |
getTitle()
The display title of the method.
|
Type |
getValueType() |
boolean |
isTrulyUnique()
If the identification method is truly unique or not.
|
<I extends BasicItem> |
prepareQuery(DbControl dc,
ItemQuery<I> query)
Adds a restriction to the query:
property = :identifier |
String |
toString() |
public static final PropertyIdMethod NAME
public static final PropertyIdMethod EXTERNAL_ID
public static final PropertyIdMethod BARCODE
private final String method
private final String property
private final String columnMappingParameterName
private final String title
private final boolean unique
private final Type valueType
public PropertyIdMethod(String method, String title, String property, String columnMappingParameterName, boolean unique, Type valueType)
method
- The method name, which should be unique among all methodstitle
- The title to use for display purposesproperty
- The name of the property to filter on when using this
id methodunique
- If this property is guaranteed to be unique or notvalueType
- The type of valuespublic String getMethod()
IdMethod
public String getTitle()
IdMethod
public String getColumnMappingParameterName()
getColumnMappingParameterName
in interface IdMethod
public boolean isTrulyUnique()
IdMethod
IdMethod.find(DbControl, ItemQuery, String)
method will
never ever return a list with more than one item.isTrulyUnique
in interface IdMethod
public <I extends BasicItem> ItemQuery<I> prepareQuery(DbControl dc, ItemQuery<I> query)
property = :identifier
prepareQuery
in interface IdMethod
query
- The query to preparepublic <I extends BasicItem> List<I> find(DbControl dc, ItemQuery<I> query, String identifier)
property = identifier
.find
in interface IdMethod
query
- The query to use, which should have been prepared
using IdMethod.prepareQuery(DbControl, ItemQuery)
identifier
- The identifier of the itemIdMethod.isTrulyUnique()
return true
the list is guaranteed to have at most one itempublic String getProperty()
public Type getValueType()