Package com.axelor.meta.db.repo
Class MetaJsonRecordRepository
- All Implemented Interfaces:
Repository<MetaJsonRecord>
Repository implementation to handle custom model records.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.axelor.db.JpaRepository
modelClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate aQueryfor the given json model.create(MetaJsonRecord record) Create aContextfor the given json model to seamlessly work with json fields.Create a newMetaJsonRecordfor the given json model with given values.save(MetaJsonRecord entity) Save the given entity.Save the json record backed by the given context.Methods inherited from class com.axelor.db.JpaRepository
all, all, copy, create, fields, find, findById, findByIds, flush, getReferenceById, isPermitted, isPermitted, merge, of, persist, populate, refresh, remove, validate
-
Constructor Details
-
MetaJsonRecordRepository
public MetaJsonRecordRepository()Create new instance of theMetaJsonRecordRepository.
-
-
Method Details
-
create
Create aContextfor the given json model to seamlessly work with json fields.For example:
Context person = repo.create("Person"); person.put("name", "Some NAME"); person.put("email", "some.name@gmail.com"); MetaJsonRecord saved = repo.save(person);- Parameters:
jsonModel- the name of the json model- Returns:
- a
Context
-
create
-
create
Create a newMetaJsonRecordfor the given json model with given values.- Parameters:
jsonModel- the name of the json modelvalues- the values to set- Returns:
- a new unsaved instance of
MetaJsonRecord
-
save
Save the json record backed by the given context.- Parameters:
context- the json record context- Returns:
- saved instance
MetaJsonRecord
-
save
Description copied from interface:RepositorySave the given entity.Depending on the implementation, it may return same entity or a copy of it. For example JPA implementation may return a copy if the given entity can't be managed.
- Specified by:
savein interfaceRepository<MetaJsonRecord>- Overrides:
savein classJpaRepository<MetaJsonRecord>- Parameters:
entity- the entity object to save- Returns:
- an instance of the entity with saved state
-
all
Create aQueryfor the given json model.- Parameters:
jsonModel- name of the json model- Returns:
- an instance of
MetaJsonRecordRepository.MetaJsonRecordQuery
-