Class InternalIdMethod
- java.lang.Object
-
- net.sf.basedb.plugins.batchimport.InternalIdMethod
-
-
Field Summary
Fields Modifier and Type Field Description static InternalIdMethod
INTERNAL_ID
Use the internal ID for finding items.private String
method
private String
title
-
Constructor Summary
Constructors Constructor Description InternalIdMethod(String method, String title)
Create a new id method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <I extends BasicItem>
List<I>find(DbControl dc, ItemQuery<I> query, String identifier)
Find the item withid = 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
getTitle()
The display title of the method.boolean
isTrulyUnique()
If the identification method is truly unique or not.<I extends BasicItem>
ItemQuery<I>prepareQuery(DbControl dc, ItemQuery<I> query)
Adds a restriction to the query:id = :identifier
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.basedb.plugins.batchimport.IdMethod
setIdentifierOnNewItem
-
-
-
-
Field Detail
-
INTERNAL_ID
public static final InternalIdMethod INTERNAL_ID
Use the internal ID for finding items.
-
method
private final String method
-
title
private final String title
-
-
Method Detail
-
getMethod
public String getMethod()
Description copied from interface:IdMethod
The name of this method, which should be unique among the methods that can be used at a given time.
-
getTitle
public String getTitle()
Description copied from interface:IdMethod
The display title of the method.
-
isTrulyUnique
public boolean isTrulyUnique()
Description copied from interface:IdMethod
If the identification method is truly unique or not. If this method returns true, theIdMethod.find(DbControl, ItemQuery, String)
method will never ever return a list with more than one item.- Specified by:
isTrulyUnique
in interfaceIdMethod
-
getColumnMappingParameterName
public String getColumnMappingParameterName()
- Specified by:
getColumnMappingParameterName
in interfaceIdMethod
-
prepareQuery
public <I extends BasicItem> ItemQuery<I> prepareQuery(DbControl dc, ItemQuery<I> query)
Adds a restriction to the query:id = :identifier
- Specified by:
prepareQuery
in interfaceIdMethod
query
- The query to prepare- Returns:
- The query that is used for item lookup
-
find
public <I extends BasicItem> List<I> find(DbControl dc, ItemQuery<I> query, String identifier)
Find the item withid = identifier
- Specified by:
find
in interfaceIdMethod
query
- The query to use, which should have been prepared usingIdMethod.prepareQuery(DbControl, ItemQuery)
identifier
- The identifier of the item- Returns:
- A list with the found items, if
IdMethod.isTrulyUnique()
return true the list is guaranteed to have at most one item
-
-