本文整理匯總了Java中org.springframework.data.rest.core.config.RepositoryRestConfiguration.exposeIdsFor方法的典型用法代碼示例。如果您正苦於以下問題:Java RepositoryRestConfiguration.exposeIdsFor方法的具體用法?Java RepositoryRestConfiguration.exposeIdsFor怎麽用?Java RepositoryRestConfiguration.exposeIdsFor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.data.rest.core.config.RepositoryRestConfiguration
的用法示例。
在下文中一共展示了RepositoryRestConfiguration.exposeIdsFor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: repositoryRestConfigurer
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Bean
public RepositoryRestConfigurer repositoryRestConfigurer() {
return new RepositoryRestConfigurerAdapter() {
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(Order.class, Item.class, Customer.class);
}
};
}
示例2: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
//config.setBasePath("api");
try {
config.exposeIdsFor(UserEntity.class);
ClassPathUtils.streamClassesAnnotatedWith(UserEntity.class, Entity.class)
.peek(clazz -> log.debug("enable @Id json mapping for entity {}", clazz.getSimpleName()))
.forEach(config::exposeIdsFor);
} catch (IOException e) {
throw new IllegalStateException("Could not exposeIds for @Entity classes");
}
}
示例3: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true);
provider.addIncludeFilter(new AssignableTypeFilter(IdentifiableEntity.class));
Set<BeanDefinition> components = provider.findCandidateComponents(this.getClass().getPackage().getName());
List<Class<?>> classes = new ArrayList<>();
components.forEach(component -> {
try {
classes.add(Class.forName(component.getBeanClassName()));
} catch (Exception e) {
e.printStackTrace();
}
});
config.exposeIdsFor(classes.toArray(new Class[classes.size()]));
}
示例4: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
public void configureRepositoryRestConfiguration(
RepositoryRestConfiguration config) {
super.configureRepositoryRestConfiguration(config);
config.exposeIdsFor(
Country.class, City.class, CountryLanguage.class);
}
示例5: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
public void configureRepositoryRestConfiguration(
RepositoryRestConfiguration config) {
super.configureRepositoryRestConfiguration(config);
config.exposeIdsFor(
Country.class);
}
示例6: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(
ServiceLevel.class,
ShipmentTrackingInfo.class,
//TrackingHistory.class,
TrackingStatus.class);
}
示例7: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
// for this time only one solution which works completely
config.exposeIdsFor(io.smsc.model.admin.User.class, User.class, Role.class, Authority.class, Group.class, Customer.class, Contact.class,
Dashboard.class, DashboardBox.class, DashboardBoxType.class);
}
示例8: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.setBaseUri(URI.create(config.getBaseUri().getPath() + "/api"));
config.exposeIdsFor(AbTestConfiguration.class);
config.exposeIdsFor(AbTestVariant.class);
config.setDefaultPageSize(1000);
}
示例9: repositoryRestConfigurer
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的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);
}
};
}
示例10: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(Article.class, Category.class, Menu.class,
PsychTest.class, PsychTestQuestion.class, PsychTestResult.class, PsychTestQuestionOption.class,
Consultant.class, Profile.class, ProfileItem.class, User.class,
CourseCategory.class, Course.class, OfficialArticle.class, Blog.class, ConsExpertise.class, Room.class, ChatMessage.class);
try {
config.setReturnBodyOnCreate(true);
config.setReturnBodyOnUpdate(true);
config.setBaseUri(new URI("/api/v1"));
} catch (URISyntaxException e) {
e.printStackTrace();
}
}
示例11: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(Authority.class);
config.exposeIdsFor(User.class);
config.exposeIdsFor(Compound.class);
config.exposeIdsFor(CompoundInVaccinationDate.class);
config.exposeIdsFor(VaccinationDate.class);
config.exposeIdsFor(Vaccination.class);
config.exposeIdsFor(VaccinationInCompound.class);
}
示例12: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
/*
Note the refences to the specific sample domain model classes.
You should/would change the arguments to the classes in your domain model.
Having the IDs exposed makes it possible to use the IDs in javascript. You COULD refer to the URI of the
instance as an identifier. But, to me it's just easier to keep the API on the client similar to the API on
the server.
*/
config.exposeIdsFor(Person.class, Possession.class);
}
示例13: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(final RepositoryRestConfiguration config) {
super.configureRepositoryRestConfiguration(config);
config.exposeIdsFor(Todo.class);
try {
config.setBaseUri(new URI("/rest"));
} catch (final URISyntaxException e) {
e.printStackTrace();
}
}
示例14: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(
RepositoryRestConfiguration config) {
super.configureRepositoryRestConfiguration(config);
config.exposeIdsFor(Employee.class);
}
示例15: configureRepositoryRestConfiguration
import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.exposeIdsFor(Movie.class);
}