Package com.jcabi.dynamo.mock
Class H2Data
- java.lang.Object
-
- com.jcabi.dynamo.mock.H2Data
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(String table, Attributes keys)Delete attributes from the given table.Iterable<Attributes>iterate(String table, Conditions conds)Iterate everything for the given table.Iterable<String>keys(String table)Get keys for the given table.voidput(String table, Attributes attrs)Add new attribute into the given table.voidupdate(String table, Attributes keys, AttributeUpdates attrs)Add new attribute into the given table.H2Datawith(String table, String[] keys, String... attrs)With this table, that has given primary keys.
-
-
-
Constructor Detail
-
H2Data
public H2Data() throws IOExceptionPublic ctor.- Throws:
IOException- If fails
-
H2Data
public H2Data(File file)
Public ctor.- Parameters:
file- Where to keep the database
-
-
Method Detail
-
keys
public Iterable<String> keys(String table) throws IOException
Description copied from interface:MkDataGet keys for the given table.- Specified by:
keysin interfaceMkData- Parameters:
table- Name of the table- Returns:
- All keys of the table
- Throws:
IOException- If fails
-
iterate
public Iterable<Attributes> iterate(String table, Conditions conds) throws IOException
Description copied from interface:MkDataIterate everything for the given table.- Specified by:
iteratein interfaceMkData- Parameters:
table- Name of the tableconds- Conditions- Returns:
- All rows found
- Throws:
IOException- If fails
-
put
public void put(String table, Attributes attrs) throws IOException
Description copied from interface:MkDataAdd new attribute into the given table.- Specified by:
putin interfaceMkData- Parameters:
table- Table nameattrs- Attributes to save- Throws:
IOException- If fails
-
update
public void update(String table, Attributes keys, AttributeUpdates attrs) throws IOException
Description copied from interface:MkDataAdd new attribute into the given table.- Specified by:
updatein interfaceMkData- Parameters:
table- Table namekeys- Keysattrs- Attributes to save- Throws:
IOException- If fails
-
delete
public void delete(String table, Attributes keys) throws IOException
Description copied from interface:MkDataDelete attributes from the given table.- Specified by:
deletein interfaceMkData- Parameters:
table- Table namekeys- Keys- Throws:
IOException- If fails
-
with
public H2Data with(String table, String[] keys, String... attrs) throws IOException
With this table, that has given primary keys.- Parameters:
table- Table namekeys- Primary keysattrs- Attributes- Returns:
- New data, modified
- Throws:
IOException- If fails
-
-