congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RepositoryDefinition
Code IndexAdd Tabnine to your IDE (free)

How to use
RepositoryDefinition
in
org.springframework.data.repository

Best Java code snippets using org.springframework.data.repository.RepositoryDefinition (Showing top 10 results out of 315)

origin: codecentric/chaos-monkey-spring-boot

@RepositoryDefinition(domainClass = Hello.class, idClass = Long.class)
public interface HelloRepoAnnotation {

  Hello save(Hello hello);

  Optional<Hello> findById(Long id);
}

origin: com.mmnaseri.utils/spring-data-mock

@Override
protected RepositoryMetadata resolveFromInterface(Class<?> repositoryInterface) {
  final RepositoryDefinition definition = repositoryInterface.getAnnotation(RepositoryDefinition.class);
  if (definition == null) {
    throw new RepositoryDefinitionException(repositoryInterface, "Expected the repository to be annotated with @RepositoryDefinition");
  }
  final Class<?> entityType = definition.domainClass();
  final Class<? extends Serializable> idType = definition.idClass();
  String idProperty = resolveIdProperty(entityType, idType);
  return new ImmutableRepositoryMetadata(idType, entityType, repositoryInterface, idProperty);
}
origin: apache/servicemix-bundles

  private Class<?> resolveDomainType(Class<?> repositoryInterface) {

    RepositoryDefinition annotation = repositoryInterface.getAnnotation(RepositoryDefinition.class);

    if (annotation == null || annotation.domainClass() == null) {
      throw new IllegalArgumentException(String.format("Could not resolve domain type of %s!", repositoryInterface));
    }

    return annotation.domainClass();
  }
}
origin: org.springframework.data/spring-data-commons-core

public Class<? extends Serializable> getIdType() {
  RepositoryDefinition annotation = repositoryInterface.getAnnotation(RepositoryDefinition.class);
  return annotation == null ? null : annotation.idClass();
}
origin: mmnaseri/spring-data-mock

@Override
protected RepositoryMetadata resolveFromInterface(Class<?> repositoryInterface) {
  final RepositoryDefinition definition = repositoryInterface.getAnnotation(RepositoryDefinition.class);
  if (definition == null) {
    throw new RepositoryDefinitionException(repositoryInterface, "Expected the repository to be annotated with @RepositoryDefinition");
  }
  final Class<?> entityType = definition.domainClass();
  final Class<? extends Serializable> idType = definition.idClass();
  String idProperty = resolveIdProperty(entityType, idType);
  return new ImmutableRepositoryMetadata(idType, entityType, repositoryInterface, idProperty);
}
origin: org.springframework.data/spring-data-commons-core

public Class<?> getDomainType() {
  RepositoryDefinition annotation = repositoryInterface.getAnnotation(RepositoryDefinition.class);
  return annotation == null ? null : annotation.domainClass();
}
origin: apache/servicemix-bundles

private Class<?> resolveIdType(Class<?> repositoryInterface) {
  RepositoryDefinition annotation = repositoryInterface.getAnnotation(RepositoryDefinition.class);
  if (annotation == null || annotation.idClass() == null) {
    throw new IllegalArgumentException(String.format("Could not resolve id type of %s!", repositoryInterface));
  }
  return annotation.idClass();
}
origin: codecentric/chaos-monkey-spring-boot

@RepositoryDefinition(domainClass = Hello.class, idClass = Long.class)
public interface HelloRepoAnnotation {

  Hello save(Hello hello);

  Optional<Hello> findById(Long id);
}

origin: gexiangdong/tutorial

@RepositoryDefinition(domainClass = TvSeries.class, idClass = Integer.class) 
public interface TvSeriesDao extends JpaRepository<TvSeries,Integer>{
  
  @Modifying
  @Query(value="update tv_series set status=-1, reason=?2 where id=?1", nativeQuery = true)
  public int logicDelete(int id, String reason);
  
}

origin: gexiangdong/tutorial

@RepositoryDefinition(domainClass = TvCharacter.class, idClass = Integer.class) 
public interface TvCharacterDao extends JpaRepository<TvCharacter, Integer>{
  
  public List<TvCharacter> getAllByTvSeriesId(int tvSeriesId);
  
}

org.springframework.data.repositoryRepositoryDefinition

Most used methods

  • <init>
  • domainClass
  • idClass

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now