@Component public class DataModel extends Object
| Constructor and Description |
|---|
DataModel()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Class<?> entityClass,
String id)
Delete entity by ID
|
com.daikit.graphql.data.output.GQLListLoadResult |
getAll(Class<?> entityClass,
com.daikit.graphql.data.input.GQLListLoadConfig listLoadConfig)
Get all entities
|
Optional<? extends AbstractEntity> |
getById(Class<?> entityClass,
String id)
Get entity by ID
|
void |
save(Object entity)
Save entity
|
public DataModel()
throws FileNotFoundException,
IOException
IOException - if file is not readableFileNotFoundException - if file is not foundpublic Optional<? extends AbstractEntity> getById(Class<?> entityClass, String id)
entityClass - the entity classid - the IDOptional entitypublic com.daikit.graphql.data.output.GQLListLoadResult getAll(Class<?> entityClass, com.daikit.graphql.data.input.GQLListLoadConfig listLoadConfig)
entityClass - the entity classlistLoadConfig - the GQLListLoadConfigGQLListLoadResultpublic void save(Object entity)
entity - the entity to be savedCopyright © 2019. All rights reserved.