com.khubla.pragmatach.plugin.mongodb
Class MongoDBDAO<T>

java.lang.Object
  extended by com.khubla.pragmatach.framework.dao.AbstractDAO<T,String>
      extended by com.khubla.pragmatach.plugin.mongodb.MongoDBDAO<T>
All Implemented Interfaces:
DAO<T,String>

public class MongoDBDAO<T>
extends AbstractDAO<T,String>

Author:
tome

Field Summary
static String ID
          _id
 
Constructor Summary
MongoDBDAO(Class<T> typeClazz)
           
 
Method Summary
 long count()
          get the count of rows in table
 void delete(T t)
          delete
 void deletebyId(String i)
          delete
 List<T> find(com.mongodb.BasicDBObject query)
          find
 List<T> find(String[][] terms)
          find
 T findById(String i)
          find by id
 T findOne(com.mongodb.BasicDBObject query)
          find
 T findOne(String[][] terms)
          find
 List<T> getAll()
          findall
 List<T> getAll(int start, int count)
          get all
 Class<String> getIdentifierClazz()
           
 Class<T> getTypeClazz()
           
 T newInstance(com.mongodb.DBObject dbObject)
          get an instance
 void reloadConfig()
          do a config reload
 void save(T t)
          save object
 void update(T t)
          update object
 
Methods inherited from class com.khubla.pragmatach.framework.dao.AbstractDAO
getPager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
_id

See Also:
Constant Field Values
Constructor Detail

MongoDBDAO

public MongoDBDAO(Class<T> typeClazz)
Method Detail

count

public long count()
           throws PragmatachException
Description copied from interface: DAO
get the count of rows in table

Throws:
PragmatachException

delete

public void delete(T t)
            throws PragmatachException
delete

Throws:
PragmatachException

deletebyId

public void deletebyId(String i)
                throws PragmatachException
delete

Throws:
PragmatachException

find

public List<T> find(com.mongodb.BasicDBObject query)
             throws PragmatachException
find

Throws:
PragmatachException

find

public List<T> find(String[][] terms)
             throws PragmatachException
find

Throws:
PragmatachException

findById

public T findById(String i)
           throws PragmatachException
find by id

Throws:
PragmatachException

findOne

public T findOne(com.mongodb.BasicDBObject query)
          throws PragmatachException
find

Throws:
PragmatachException

findOne

public T findOne(String[][] terms)
          throws PragmatachException
find

Throws:
PragmatachException

getAll

public List<T> getAll()
               throws PragmatachException
findall

Throws:
PragmatachException

getAll

public List<T> getAll(int start,
                      int count)
               throws PragmatachException
Description copied from interface: DAO
get all

Throws:
PragmatachException

getIdentifierClazz

public Class<String> getIdentifierClazz()

getTypeClazz

public Class<T> getTypeClazz()

newInstance

public T newInstance(com.mongodb.DBObject dbObject)
              throws PragmatachException
get an instance

Throws:
PragmatachException

reloadConfig

public void reloadConfig()
Description copied from interface: DAO
do a config reload


save

public void save(T t)
          throws PragmatachException
save object

Throws:
PragmatachException

update

public void update(T t)
            throws PragmatachException
update object

Throws:
PragmatachException


Copyright © 2014 khubla.com. All rights reserved.