Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package jpaoletti.jpm.core;
  
  import java.util.List;

An entity data access offers the basic methods to operate over the data source of an entity.

Author(s):
jpaoletti
 
 public interface DataAccess {

    
Setter for the entity
 
     public void setEntity(Entity entity);

    
Getter for the entity
 
     public Entity getEntity();

    
Getter for the id of an object. If entity.idField is null, null is

Parameters:
ctx The context
instanceWrapper The instance to identify
id The string representation of some identification.
 
     public InstanceId getInstanceId(PMContext ctxEntityInstanceWrapper instanceWrapperthrows PMException;

    
Get an item from data source an item identified by the property=value

Parameters:
ctx The context
property The property to look up
value The value of the property that must be looked for.
Returns:
The object or null of not found
Throws:
PMException
 
     public Object getItem(PMContext ctxString propertyString valuethrows PMException;

    
Get an item by id, if the entity has idField. If not, null is returned.

Parameters:
ctx The context
instanceId The value of the id that must be looked for. @see InstanceId
Returns:
The object or null of not found
Throws:
PMException
 
     public Object getItem(PMContext ctxInstanceId instanceIdthrows PMException;

    
Get a filtered list of items from data source with the given items

Parameters:
ctx The context
filter The filter of the list
sort List sort
from The starting index of the list
count The maximum number of resultant items
Returns:
The list of items
Throws:
PMException
 
     public List<?> list(PMContext ctxEntityFilter filterListFilter lfilterListSort sortInteger fromInteger countthrows PMException;

    
Get the total number of items of the entity

Parameters:
ctx The context
Returns:
Item total count
Throws:
PMException
 
     public Long count(PMContext ctxthrows PMException;

    
Removes the object from data source

Parameters:
ctx The context
object The object to remove
Throws:
PMException
 
     public void delete(PMContext ctxObject objectthrows PMException;

    
Updates the given object

Parameters:
ctx The context
instance The modified object
Throws:
PMException
 
     public void update(PMContext ctxObject instancethrows PMException;

    
Adds the object to the data source

Parameters:
ctx The context
instance The new object
Throws:
PMException
 
     public void add(PMContext ctxObject instancethrows PMException;

    
Synchronize the referenced object with the data source

Parameters:
ctx The context
o The object to refresh
Returns:
Fresh object
Throws:
PMException
    public Object refresh(PMContext ctxObject othrows PMException;

    
Creates a new instance of the specific class of this data access

Parameters:
ctx The context
Returns:
the new filter
Throws:
PMException
    public EntityFilter createFilter(PMContext ctxthrows PMException;
New to GrepCode? Check out our FAQ X