本文整理汇总了Java中org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryRestConfigurerAdapter类的具体用法?Java RepositoryRestConfigurerAdapter怎么用?Java RepositoryRestConfigurerAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryRestConfigurerAdapter类属于org.springframework.data.rest.webmvc.config包,在下文中一共展示了RepositoryRestConfigurerAdapter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: repositoryRestConfigurer
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; //导入依赖的package包/类
@Bean
public RepositoryRestConfigurer repositoryRestConfigurer() {
return new RepositoryRestConfigurerAdapter() {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(Order.class, Item.class, Customer.class);
}
};
}
示例2: repositoryRestConfigurer
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; //导入依赖的package包/类
@Bean
public RepositoryRestConfigurer repositoryRestConfigurer() {
return new RepositoryRestConfigurerAdapter() {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.setRepositoryDetectionStrategy(
RepositoryDetectionStrategy.RepositoryDetectionStrategies.ANNOTATED
);
}
@Override
public void configureJacksonObjectMapper(ObjectMapper objectMapper) {
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
objectMapper.registerModule(new AfterburnerModule()); //MOAR SPEED
}
};
}
示例3: repositoryRestConfigurer
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; //导入依赖的package包/类
@Bean
public RepositoryRestConfigurer repositoryRestConfigurer() {
return new RepositoryRestConfigurerAdapter() {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.setDefaultPageSize(150);
}
};
}
示例4: repositoryRestConfigurer
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; //导入依赖的package包/类
/**
* define classes which should retourn the id's.
*
* @return RepositoryRestConfigurer
*/
@Bean
public RepositoryRestConfigurer repositoryRestConfigurer() {
return new RepositoryRestConfigurerAdapter() {
@Override
public void configureRepositoryRestConfiguration(final RepositoryRestConfiguration config) {
config.exposeIdsFor(Person.class);
}
};
}
示例5: repositoryRestConfigurer
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter; //导入依赖的package包/类
@Bean
public RepositoryRestConfigurer repositoryRestConfigurer() {
return new RepositoryRestConfigurerAdapter() {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.setBasePath("/api");
}
};
}