public class MultiPropertyIdMethod extends java.lang.Object implements IdMethod
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
method |
static MultiPropertyIdMethod |
NAME_OR_BARCODE
Use the name or barcode for finding items.
|
static MultiPropertyIdMethod |
NAME_OR_EXTERNALID
Use the name or external ID for finding items.
|
static MultiPropertyIdMethod |
NAME_OR_SYSTEMID
Use the name or system Id for finding items.
|
private java.lang.String[] |
properties |
private java.lang.String |
title |
private boolean |
unique |
private Type |
valueType |
Constructor and Description |
---|
MultiPropertyIdMethod(java.lang.String method,
java.lang.String title,
java.lang.String[] properties,
boolean unique,
Type valueType)
Create a new id method.
|
Modifier and Type | Method and Description |
---|---|
<I extends BasicItem> |
find(DbControl dc,
ItemQuery<I> query,
java.lang.String identifier)
Find all items with
property[0] = identifier ,
or property[1] = identifier, .... |
java.lang.String |
getColumnMappingParameterName() |
java.lang.String |
getMethod()
The name of this method, which should be unique among the methods that
can be used at a given time.
|
java.lang.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[0] = :identifier OR property[1] = :identifier .... |
java.lang.String |
toString() |
public static final MultiPropertyIdMethod NAME_OR_EXTERNALID
public static final MultiPropertyIdMethod NAME_OR_BARCODE
public static final MultiPropertyIdMethod NAME_OR_SYSTEMID
private final java.lang.String method
private final java.lang.String[] properties
private final java.lang.String title
private final boolean unique
private final Type valueType
public MultiPropertyIdMethod(java.lang.String method, java.lang.String title, java.lang.String[] properties, boolean unique, Type valueType)
method
- The method name, which should be unique among all methodstitle
- The title to use for display purposesproperties
- The name of the properties to filter on when using this
id methodunique
- If this property is guaranteed to be unique or notvalueType
- The type of valuespublic java.lang.String getMethod()
IdMethod
public java.lang.String getTitle()
IdMethod
public java.lang.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[0] = :identifier OR property[1] = :identifier ....
prepareQuery
in interface IdMethod
query
- The query to preparepublic <I extends BasicItem> java.util.List<I> find(DbControl dc, ItemQuery<I> query, java.lang.String identifier)
property[0] = identifier
,
or property[1] = 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 java.lang.String toString()
toString
in class java.lang.Object
public Type getValueType()