Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package hbm.service.jpa;
  
  
  import java.util.List;

The Interface BusinessService.

Parameters:
<T> the type of the domain object
<PK> the type of the primary key from the domain object
 
 public interface BusinessService<T extends BaseEntity<PK>, PK extends Serializableextends
Delete all persistent objects in the given list.

Parameters:
objects the list with the persistent objects to delete
 
 	void delete(final List<T> objects);

Deletes an object of a given Id. Will load the object internally so consider using delete (T obj) directly

Parameters:
id the id
 
 	void delete(PK id);

Deletes the given object from persistent storage in the database.

Parameters:
object the persistent object
 
 	void delete(T object);

Remove this instance from the session cache.

Parameters:
object the object to evict.
 
 	void evict(T object);

Checks if an entry exists with the given id.

Parameters:
id the id to check
Returns:
true, if an entry exists with the given id, otherwise false.
 
 	boolean exists(PK id);

Returns a list of objects.

Returns:
list of objects
 
 	List<T> findAll();

Retrieve a persisted object with a given id from the database.

Parameters:
id the id
Returns:
An object of type T
 
 	T get(PK id);

Retrieve a persisted object with a given id from the database.

Parameters:
id the id
Returns:
An object of type T
 
 	T load(PK id);

Merges the given object.

Parameters:
object the object
Returns:
the object
See also:
Hibernate documentation.
 
 	T merge(final T object);

Merges all new objects in the given list.

Parameters:
objects the list to save
Returns:
the list with the ids of the merged objects
	List<T> merge(List<T> objects);

Re-read the state of the given instance from the underlying database.

Parameters:
object the object to refresh.
	void refresh(final T object);

Save all new objects in the given list.

Parameters:
objects the list to save
Returns:
the list with the ids of the saved objects
	List<PK> save(List<T> objects);

Persist the given object into database.

Parameters:
object the new instance to save.
Returns:
the id of the saved object
	PK save(T object);

Save or update all given objects into database.

Parameters:
objects the objects to save or update.
	void saveOrUpdate(List<T> objects);

Save or update the given object into database.

Parameters:
object the object to save or update.
	void saveOrUpdate(T object);
New to GrepCode? Check out our FAQ X