All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.data.cassandra.repository.CassandraRepository Maven / Gradle / Ivy

There is a newer version: 4.3.4
Show newest version
package org.springframework.data.cassandra.repository;

import java.io.Serializable;

import org.springframework.data.cassandra.mapping.PrimaryKeyColumn;
import org.springframework.data.cassandra.repository.support.BasicMapId;
import org.springframework.data.repository.NoRepositoryBean;

/**
 * Basic Cassandra repository interface.
 * 

* This interface uses {@link MapId} for the id type, allowing you to annotate entity fields or properties with * {@link PrimaryKeyColumn @PrimaryKeyColumn}. For a full discussion of this interface, including the use of custom * primary key classes, see {@link TypedIdCassandraRepository}. *

* Steps to use this interface: *

    *
  • Define your entity, including a field or property for each column, including those for partition and (optional) * cluster columns.
  • *
  • Annotate each partition & cluster field or property with {@link PrimaryKeyColumn @PrimaryKeyColumn}
  • *
  • Define your repository interface to be a subinterface of this interface, which uses a provided id type, * {@link MapId} (implemented by {@link BasicMapId}).
  • *
  • Whenever you need a {@link MapId}, you can use the static factory method {@link BasicMapId#id()} (which is * convenient if you import statically) and the builder method {@link MapId#with(String, Serializable)} to easily * construct an id.
  • *
  • Optionally, entity class authors can have their entities implement {@link MapIdentifiable}, to make it easier and * quicker for entity clients to get the entity's identity.
  • *
* * @param The type of the persistent entity. * @see TypedIdCassandraRepository * @see MapId * @See {@link MapIdentifiable} * @author Matthew T. Adams */ @NoRepositoryBean public interface CassandraRepository extends TypedIdCassandraRepository {}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy