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 void
delete(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.void
put(String table, Attributes attrs)
Add new attribute into the given table.void
update(String table, Attributes keys, AttributeUpdates attrs)
Add new attribute into the given table.H2Data
with(String table, String[] keys, String... attrs)
With this table, that has given primary keys.
-
-
-
Constructor Detail
-
H2Data
public H2Data() throws IOException
Public 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:MkData
Get keys for the given table.- Specified by:
keys
in 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:MkData
Iterate everything for the given table.- Specified by:
iterate
in 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:MkData
Add new attribute into the given table.- Specified by:
put
in 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:MkData
Add new attribute into the given table.- Specified by:
update
in 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:MkData
Delete attributes from the given table.- Specified by:
delete
in 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
-
-