org.ektorp.support
Interface GenericRepository<T>

Type Parameters:
T -
All Known Implementing Classes:
CouchDbRepositorySupport

public interface GenericRepository<T>

Author:
henrik lundgren

Method Summary
 void add(T entity)
           
 boolean contains(String docId)
           
 T get(String id)
           
 T get(String id, String rev)
           
 List<T> getAll()
           
 void remove(T entity)
           
 void update(T entity)
           
 

Method Detail

add

void add(T entity)
Parameters:
entity -
Throws:
UpdateConflictException - if there was an update conflict.

update

void update(T entity)
Parameters:
entity -
Throws:
UpdateConflictException - if there was an update conflict.

remove

void remove(T entity)
Parameters:
entity -
Throws:
UpdateConflictException - if there was an update conflict.

get

T get(String id)
Parameters:
id -
Returns:
Throws:
DocumentNotFoundException - if the document was not found.

get

T get(String id,
      String rev)
Parameters:
id -
rev -
Returns:
Throws:
DocumentNotFoundException - if the document was not found.

getAll

List<T> getAll()
Returns:
empty list if nothing was found.

contains

boolean contains(String docId)
Parameters:
docId -
Returns:
true if a document with the specified id exists in the database.


Copyright © 2011. All Rights Reserved.