com.googlecode.jdbw.jorm
Class JORMDatabase

java.lang.Object
  extended by com.googlecode.jdbw.jorm.JORMDatabase

public class JORMDatabase
extends Object


Nested Class Summary
static class JORMDatabase.SearchPolicy
           
 
Constructor Summary
JORMDatabase(DatabaseConnection databaseConnection)
           
JORMDatabase(DatabaseConnection databaseConnection, ClassTableMapping defaultClassTableMapping, EntityInitializer defaultEntityInitializer)
           
 
Method Summary
<U,T extends JORMEntity<U>>
T
get(Class<T> type, U key)
           
<U,T extends JORMEntity<U>>
T
get(Class<T> type, U key, JORMDatabase.SearchPolicy searchPolicy)
           
<U,T extends JORMEntity<U>>
ArrayList<T>
getAll(Class<T> type)
           
<U,T extends JORMEntity<U>>
List<T>
newEntities(Class<T> type, int numberOfEntities)
           
<U,T extends JORMEntity<U>>
List<T>
newEntities(Class<T> type, U... ids)
           
<U,T extends JORMEntity<U>>
T
newEntity(Class<T> type)
           
<U,T extends JORMEntity<U>>
T
newEntity(Class<T> type, U id)
           
<U,T extends JORMEntity<U>>
void
persist(Collection<T> entities)
           
<U,T extends JORMEntity<U>>
void
persist(T... entities)
           
<U,T extends JORMEntity<U>>
T
persist(T entity)
           
 void refresh()
           
<U,T extends JORMEntity<U>>
void
refresh(Class<T> entityType)
           
<U,T extends JORMEntity<U>>
void
refresh(Class<T> entityType, U... keys)
           
 void refresh(Executor executor)
           
<U,T extends JORMEntity<U>>
void
refresh(T... entities)
           
<U,T extends JORMEntity<U>>
void
register(Class<T> entityType)
           
<U,T extends JORMEntity<U>>
void
register(Class<T> entityType, ClassTableMapping classTableMapping)
           
<U,T extends JORMEntity<U>>
void
register(Class<T> entityType, ClassTableMapping classTableMapping, EntityInitializer initializer)
           
<U,T extends JORMEntity<U>>
void
remove(Class<T> entityType, Collection<U> ids)
           
<U,T extends JORMEntity<U>>
void
remove(Class<T> entityType, U... ids)
           
<U,T extends JORMEntity<U>>
void
remove(Collection<T> entities)
           
<U,T extends JORMEntity<U>>
void
remove(T... entities)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JORMDatabase

public JORMDatabase(DatabaseConnection databaseConnection)

JORMDatabase

public JORMDatabase(DatabaseConnection databaseConnection,
                    ClassTableMapping defaultClassTableMapping,
                    EntityInitializer defaultEntityInitializer)
Method Detail

getAll

public <U,T extends JORMEntity<U>> ArrayList<T> getAll(Class<T> type)

get

public <U,T extends JORMEntity<U>> T get(Class<T> type,
                                         U key)

get

public <U,T extends JORMEntity<U>> T get(Class<T> type,
                                         U key,
                                         JORMDatabase.SearchPolicy searchPolicy)

newEntity

public <U,T extends JORMEntity<U>> T newEntity(Class<T> type)
                                  throws SQLException
Throws:
SQLException

newEntity

public <U,T extends JORMEntity<U>> T newEntity(Class<T> type,
                                               U id)
                                  throws SQLException
Throws:
SQLException

newEntities

public <U,T extends JORMEntity<U>> List<T> newEntities(Class<T> type,
                                                       int numberOfEntities)
                                          throws SQLException
Throws:
SQLException

newEntities

public <U,T extends JORMEntity<U>> List<T> newEntities(Class<T> type,
                                                       U... ids)
                                          throws SQLException
Throws:
SQLException

persist

public <U,T extends JORMEntity<U>> T persist(T entity)
                                throws SQLException
Throws:
SQLException

persist

public <U,T extends JORMEntity<U>> void persist(T... entities)
             throws SQLException
Throws:
SQLException

persist

public <U,T extends JORMEntity<U>> void persist(Collection<T> entities)
             throws SQLException
Throws:
SQLException

remove

public <U,T extends JORMEntity<U>> void remove(T... entities)
            throws SQLException
Throws:
SQLException

remove

public <U,T extends JORMEntity<U>> void remove(Collection<T> entities)
            throws SQLException
Throws:
SQLException

remove

public <U,T extends JORMEntity<U>> void remove(Class<T> entityType,
                                               U... ids)
            throws SQLException
Throws:
SQLException

remove

public <U,T extends JORMEntity<U>> void remove(Class<T> entityType,
                                               Collection<U> ids)
            throws SQLException
Throws:
SQLException

refresh

public void refresh()

refresh

public void refresh(Executor executor)

refresh

public <U,T extends JORMEntity<U>> void refresh(T... entities)

refresh

public <U,T extends JORMEntity<U>> void refresh(Class<T> entityType)

refresh

public <U,T extends JORMEntity<U>> void refresh(Class<T> entityType,
                                                U... keys)

register

public <U,T extends JORMEntity<U>> void register(Class<T> entityType)

register

public <U,T extends JORMEntity<U>> void register(Class<T> entityType,
                                                 ClassTableMapping classTableMapping)

register

public <U,T extends JORMEntity<U>> void register(Class<T> entityType,
                                                 ClassTableMapping classTableMapping,
                                                 EntityInitializer initializer)


Copyright © 2012. All Rights Reserved.