接口 JavaRepository<E,ID>
- 类型参数:
E- The entity typeID- The entity id type
- 所有已知实现类:
AbstractJavaRepository
public interface JavaRepository<E,ID>
In earlier versions of Jimmer, type
JRepository
was used to support spring data style repository support.
However, based on user feedback, this interface was rarely used. The root causes are:
- Unlike JPA and MyBatis, which have lifecycle management objects like EntityManager/Session, Jimmer itself is already designed with a stateless API. Therefore, the stateless abstraction of spring dData style repository is meaningless for Jimmer.
- Jimmer itself emphasizes type safety and strives to detect problems at compile-time.
spring data's approach based on conventional method names and
@Queryannotations would lead to problems only being found at runtime (How Intellij helps certain solutions cheat is not discussed here), which goes against Jimmer's design philosophy.
Repository. At this point, users can choose to implement this interface or extends class
AbstractJavaRepository. Note, that this is optional, not mandatory.-
方法概要
修饰符和类型方法说明default longdeleteById(ID id) longdeleteById(ID id, org.babyfish.jimmer.sql.ast.mutation.DeleteMode deleteMode) default longdeleteByIds(Iterable<ID> ids) longdeleteByIds(Iterable<ID> ids, org.babyfish.jimmer.sql.ast.mutation.DeleteMode deleteMode) findAll(org.babyfish.jimmer.meta.TypedProp.Scalar<?, ?>... sortedProps) findAll(org.babyfish.jimmer.sql.fetcher.Fetcher<E> fetcher, org.babyfish.jimmer.meta.TypedProp.Scalar<?, ?>... sortedProps) default E<V extends org.babyfish.jimmer.View<E>>
VfindMapByIds(Iterable<ID> ids) findMapByIds(Iterable<ID> ids, Class<V> viewType) findMapByIds(Iterable<ID> ids, org.babyfish.jimmer.sql.fetcher.Fetcher<E> fetcher) <V extends org.babyfish.jimmer.View<E>>
org.babyfish.jimmer.Page<V>findPage(PageParam pageParam, Class<V> viewType, org.babyfish.jimmer.meta.TypedProp.Scalar<?, ?>... sortedProps) default org.babyfish.jimmer.Page<E>org.babyfish.jimmer.Page<E>findPage(PageParam pageParam, org.babyfish.jimmer.sql.fetcher.Fetcher<E> fetcher, org.babyfish.jimmer.meta.TypedProp.Scalar<?, ?>... sortedProps) <V extends org.babyfish.jimmer.View<E>>
org.babyfish.jimmer.Slice<V>findSlice(int limit, int offset, Class<V> viewType, org.babyfish.jimmer.meta.TypedProp.Scalar<?, ?>... sortedProps) default org.babyfish.jimmer.Slice<E>findSlice(int limit, int offset, org.babyfish.jimmer.meta.TypedProp.Scalar<?, ?>... sortedProps) org.babyfish.jimmer.Slice<E>findSlice(int limit, int offset, org.babyfish.jimmer.sql.fetcher.Fetcher<E> fetcher, org.babyfish.jimmer.meta.TypedProp.Scalar<?, ?>... sortedProps) default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.insert(Object), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.insert(Object, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.insert(Input), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>insert(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.insert(Input, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>insertIfAbsent(E entity) Shortcut forJSqlClient.insertIfAbsent(Object), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>insertIfAbsent(E entity, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.insertIfAbsent(Object, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>insertIfAbsent(org.babyfish.jimmer.Input<E> input) Shortcut forJSqlClient.insertIfAbsent(Input), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>insertIfAbsent(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.insertIfAbsent(Input, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.merge(Object), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.merge(Object, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.merge(Input), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>merge(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.merge(Input, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut orJSqlClient.save(Object), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.save(Object, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.save(Object, SaveMode), please view that method to know moreorg.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>save(E entity, org.babyfish.jimmer.sql.ast.mutation.SaveMode mode, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedMode) Shortcut forJSqlClient.save(Object, SaveMode, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.save(Input))}, please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>save(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedMode) Shortcut forJSqlClient.insertIfAbsent(Input, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.save(Input, SaveMode), please view that method to know moreorg.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>save(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.SaveMode rootSaveMode, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.save(Input, SaveMode, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E>saveEntities(Iterable<E> entities) Shortcut forJSqlClient.saveEntities(Iterable), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E>saveEntities(Iterable<E> entities, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedMode) Shortcut forJSqlClient.saveEntities(Iterable, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E>saveEntities(Iterable<E> entities, org.babyfish.jimmer.sql.ast.mutation.SaveMode mode) Shortcut forJSqlClient.saveEntities(Iterable, SaveMode), please view that method to know moreorg.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E>saveEntities(Iterable<E> entities, org.babyfish.jimmer.sql.ast.mutation.SaveMode rootSaveMode, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.saveEntities(Iterable, SaveMode, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E>saveInputs(Iterable<org.babyfish.jimmer.Input<E>> inputs) Shortcut forJSqlClient.saveInputs(Iterable), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E>saveInputs(Iterable<org.babyfish.jimmer.Input<E>> inputs, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedMode) Shortcut forJSqlClient.saveInputs(Iterable, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E>saveInputs(Iterable<org.babyfish.jimmer.Input<E>> inputs, org.babyfish.jimmer.sql.ast.mutation.SaveMode mode) Shortcut forJSqlClient.save(Input, SaveMode), please view that method to know moreorg.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E>saveInputs(Iterable<org.babyfish.jimmer.Input<E>> inputs, org.babyfish.jimmer.sql.ast.mutation.SaveMode rootSaveMode, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.saveInputs(Iterable, SaveMode, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.update(Object), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.update(Object, AssociatedSaveMode), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>Shortcut forJSqlClient.update(Input), please view that method to know moredefault org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E>update(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.update(Input, AssociatedSaveMode), please view that method to know more
-
方法详细资料
-
findById
-
findById
-
findById
-
findByIds
-
findByIds
-
findByIds
-
findMapByIds
-
findMapByIds
-
findMapByIds
-
findAll
-
findAll
-
findAll
-
findPage
-
findPage
-
findPage
-
findSlice
@NotNull default org.babyfish.jimmer.Slice<E> findSlice(int limit, int offset, org.babyfish.jimmer.meta.TypedProp.Scalar<?, ?>... sortedProps) -
findSlice
-
findSlice
-
save
Shortcut orJSqlClient.save(Object), please view that method to know more -
save
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> save(E entity, org.babyfish.jimmer.sql.ast.mutation.SaveMode mode) Shortcut forJSqlClient.save(Object, SaveMode), please view that method to know more -
save
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> save(E entity, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedMode) Shortcut forJSqlClient.save(Object, AssociatedSaveMode), please view that method to know more -
save
org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> save(E entity, org.babyfish.jimmer.sql.ast.mutation.SaveMode mode, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedMode) Shortcut forJSqlClient.save(Object, SaveMode, AssociatedSaveMode), please view that method to know more -
insert
Shortcut forJSqlClient.insert(Object), please view that method to know more -
insert
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> insert(E entity, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.insert(Object, AssociatedSaveMode), please view that method to know more -
insert
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> insert(org.babyfish.jimmer.Input<E> input) Shortcut forJSqlClient.insert(Input), please view that method to know more -
insert
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> insert(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.insert(Input, AssociatedSaveMode), please view that method to know more -
insertIfAbsent
Shortcut forJSqlClient.insertIfAbsent(Object), please view that method to know more -
insertIfAbsent
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> insertIfAbsent(E entity, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.insertIfAbsent(Object, AssociatedSaveMode), please view that method to know more -
insertIfAbsent
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> insertIfAbsent(org.babyfish.jimmer.Input<E> input) Shortcut forJSqlClient.insertIfAbsent(Input), please view that method to know more -
insertIfAbsent
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> insertIfAbsent(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.insertIfAbsent(Input, AssociatedSaveMode), please view that method to know more -
update
Shortcut forJSqlClient.update(Object), please view that method to know more -
update
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> update(E entity, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.update(Object, AssociatedSaveMode), please view that method to know more -
update
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> update(org.babyfish.jimmer.Input<E> input) Shortcut forJSqlClient.update(Input), please view that method to know more -
update
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> update(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.update(Input, AssociatedSaveMode), please view that method to know more -
merge
Shortcut forJSqlClient.merge(Object), please view that method to know more -
merge
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> merge(E entity, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.merge(Object, AssociatedSaveMode), please view that method to know more -
merge
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> merge(org.babyfish.jimmer.Input<E> input) Shortcut forJSqlClient.merge(Input), please view that method to know more -
merge
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> merge(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.merge(Input, AssociatedSaveMode), please view that method to know more -
saveEntities
Shortcut forJSqlClient.saveEntities(Iterable), please view that method to know more -
saveEntities
default org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E> saveEntities(Iterable<E> entities, org.babyfish.jimmer.sql.ast.mutation.SaveMode mode) Shortcut forJSqlClient.saveEntities(Iterable, SaveMode), please view that method to know more -
saveEntities
default org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E> saveEntities(Iterable<E> entities, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedMode) Shortcut forJSqlClient.saveEntities(Iterable, AssociatedSaveMode), please view that method to know more -
saveEntities
org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E> saveEntities(Iterable<E> entities, org.babyfish.jimmer.sql.ast.mutation.SaveMode rootSaveMode, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.saveEntities(Iterable, SaveMode, AssociatedSaveMode), please view that method to know more -
save
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> save(org.babyfish.jimmer.Input<E> input) Shortcut forJSqlClient.save(Input))}, please view that method to know more -
save
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> save(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.SaveMode mode) Shortcut forJSqlClient.save(Input, SaveMode), please view that method to know more -
save
default org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> save(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedMode) Shortcut forJSqlClient.insertIfAbsent(Input, AssociatedSaveMode), please view that method to know more -
save
org.babyfish.jimmer.sql.ast.mutation.SimpleSaveResult<E> save(org.babyfish.jimmer.Input<E> input, org.babyfish.jimmer.sql.ast.mutation.SaveMode rootSaveMode, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.save(Input, SaveMode, AssociatedSaveMode), please view that method to know more -
saveInputs
default org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E> saveInputs(Iterable<org.babyfish.jimmer.Input<E>> inputs) Shortcut forJSqlClient.saveInputs(Iterable), please view that method to know more -
saveInputs
default org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E> saveInputs(Iterable<org.babyfish.jimmer.Input<E>> inputs, org.babyfish.jimmer.sql.ast.mutation.SaveMode mode) Shortcut forJSqlClient.save(Input, SaveMode), please view that method to know more -
saveInputs
default org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E> saveInputs(Iterable<org.babyfish.jimmer.Input<E>> inputs, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedMode) Shortcut forJSqlClient.saveInputs(Iterable, AssociatedSaveMode), please view that method to know more -
saveInputs
org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult<E> saveInputs(Iterable<org.babyfish.jimmer.Input<E>> inputs, org.babyfish.jimmer.sql.ast.mutation.SaveMode rootSaveMode, org.babyfish.jimmer.sql.ast.mutation.AssociatedSaveMode associatedSaveMode) Shortcut forJSqlClient.saveInputs(Iterable, SaveMode, AssociatedSaveMode), please view that method to know more -
deleteById
-
deleteById
-
deleteByIds
-
deleteByIds
-