Package org.openbravo.service.db
Class ClientImportEntityResolver
- java.lang.Object
-
- org.openbravo.dal.xml.EntityResolver
-
- org.openbravo.service.db.ClientImportEntityResolver
-
- All Implemented Interfaces:
OBNotSingleton
,OBProvidable
public class ClientImportEntityResolver extends EntityResolver
This entity resolver is used in complete Client imports. With complete Client imports all the data on Client/Organization level is present in the xml String. This means that the EntityResolver only needs to search for existing objects on System level. This class overrides some methods from theEntityResolver
to accomplish this. New objects are assumed to have the client/organization set through the xml.This resolver does not query the AD_REF_DATA_LOADED table.
- Author:
- mtaal
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openbravo.dal.xml.EntityResolver
EntityResolver.ResolvingMode
-
-
Constructor Summary
Constructors Constructor Description ClientImportEntityResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BaseOBObject
findUniqueConstrainedObject(BaseOBObject obObject)
static ClientImportEntityResolver
getInstance()
BaseOBObject
resolve(String entityName, String id, boolean referenced)
Searches for a existing entity with the same id.BaseOBObject
resolve(String entityName, String id, boolean referenced, boolean filterOrganizations)
Searches for an entity using the entityname and the id, first the internal cache is searched and then the database.BaseOBObject
searchInstance(Entity entity, String id)
protected void
setClient(Client client)
protected void
setOrganization(Organization organization)
-
Methods inherited from class org.openbravo.dal.xml.EntityResolver
addObjectToCaches, doSearch, doSearch, exchangeObjects, getClient, getClientZero, getData, getKey, getObjectUsingOriginalId, getOrganization, getOrganizationZero, getOriginalId, getResolvingMode, isOptionCreateReferencedIfNotFound, search, searchClient, searchClientOrganization, searchSystem, setClientOrganization, setClientOrganizationZero, setOptionCreateReferencedIfNotFound, setResolvingMode
-
-
-
-
Method Detail
-
getInstance
public static ClientImportEntityResolver getInstance()
-
resolve
public BaseOBObject resolve(String entityName, String id, boolean referenced)
Searches for a existing entity with the same id. Only searches on system level.- Overrides:
resolve
in classEntityResolver
- Parameters:
entityName
- the name of the entity to resolveid
- the idreferenced
- is true if the entity needs to be resolved because it is referenced from imported data, is false if the entity is part of the main imported dataset- See Also:
BaseOBObject.getEntityName()
,EntityResolver.resolve(String, String, boolean)
-
resolve
public BaseOBObject resolve(String entityName, String id, boolean referenced, boolean filterOrganizations)
Description copied from class:EntityResolver
Searches for an entity using the entityname and the id, first the internal cache is searched and then the database. Depending if the entity is searched for as a reference or as a main object (in the root of the xml) the search is differs. If no existing object can be found then new one is created..- Overrides:
resolve
in classEntityResolver
- Parameters:
entityName
- the name of the entity searched forid
- the id, can be nullreferenced
- if the entity is searched because it is refered to or if it is in the root of the xml- Returns:
- an existing or a new entity
-
searchInstance
public BaseOBObject searchInstance(Entity entity, String id)
- Overrides:
searchInstance
in classEntityResolver
-
findUniqueConstrainedObject
protected BaseOBObject findUniqueConstrainedObject(BaseOBObject obObject)
- Overrides:
findUniqueConstrainedObject
in classEntityResolver
-
setClient
protected void setClient(Client client)
- Overrides:
setClient
in classEntityResolver
-
setOrganization
protected void setOrganization(Organization organization)
- Overrides:
setOrganization
in classEntityResolver
-
-