Codota Logo
RepositoryDefinition
Code IndexAdd Codota 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)

  • Common ways to obtain RepositoryDefinition
private void myMethod () {
RepositoryDefinition r =
  • Codota IconClass klass;klass.getAnnotation(RepositoryDefinition.class)
  • Smart code suggestions by Codota
}
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

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now