@NoRepositoryBean public interface TypedIdCassandraRepository<T,ID extends Serializable> extends CrudRepository<T,ID>
CrudRepository
interface that allows the specification of a type for the
identity of the @Table
(or @Persistable
) type.
If a single column comprises the identity of the entity, then you must do one of two things:
@PrimaryKey
and declare your repository
interface to be a subinterface of this interface, specifying the entity type and id type, or@PrimaryKeyColumn
and declare your
repository interface to be a subinterface of CassandraRepository
.@PrimaryKeyClass
) that represents your
entity's identity.@PrimaryKey
.CassandraRepository
@PrimaryKeyColumn
CassandraRepository
, which uses a provided id
type, MapId
(implemented by BasicMapId
).MapId
, you can use the static factory method BasicMapId.id()
(which is
convenient if you import statically) and the builder method MapId.with(String, Serializable)
to easily
construct an id.Modifier and Type | Method and Description |
---|---|
<S extends T> |
insert(S entity)
Inserts the given entity.
|
<S extends T> S insert(S entity)
CrudRepository.save(Object)
instead to avoid the usage of store-specific API.entity
- must not be null.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.