當前位置: 首頁>>代碼示例>>Java>>正文


Java RepositoryRestConfiguration.exposeIdsFor方法代碼示例

本文整理匯總了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);
		}
	};
}
 
開發者ID:ewolff,項目名稱:microservice-atom,代碼行數:11,代碼來源:SpringRestDataConfig.java

示例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");
    }
}
 
開發者ID:amvnetworks,項目名稱:amv-access-api-poc,代碼行數:14,代碼來源:RepositoryConfig.java

示例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()]));
}
 
開發者ID:thomasletsch,項目名稱:moserp,代碼行數:18,代碼來源:RestConfiguration.java

示例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);
}
 
開發者ID:ceefour,項目名稱:java-web-services-training,代碼行數:8,代碼來源:RepositoryConfig.java

示例5: configureRepositoryRestConfiguration

import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
public void configureRepositoryRestConfiguration(
        RepositoryRestConfiguration config) {
    super.configureRepositoryRestConfiguration(config);
    config.exposeIdsFor(
            Country.class);
}
 
開發者ID:ceefour,項目名稱:java-web-services-training,代碼行數:8,代碼來源:RepositoryConfig.java

示例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);
}
 
開發者ID:pacphi,項目名稱:track-shipments,代碼行數:9,代碼來源:RepositoryRestResourceConfig.java

示例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);
}
 
開發者ID:bulktrade,項目名稱:SMSC,代碼行數:8,代碼來源:RepositoryIdExposingConfiguration.java

示例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);
}
 
開發者ID:ImmobilienScout24,項目名稱:switchman,代碼行數:8,代碼來源:RestMvc.java

示例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);
    }
  };
}
 
開發者ID:ManfredTremmel,項目名稱:gwt-bean-validators-example,代碼行數:15,代碼來源:SpringDataConfig.java

示例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();
  }
}
 
開發者ID:perrywang,項目名稱:dionysus,代碼行數:15,代碼來源:RestfulConfiguration.java

示例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);
}
 
開發者ID:tsurelad,項目名稱:Midaat-Vaccination-Microservice,代碼行數:11,代碼來源:ExposeIds.java

示例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);
}
 
開發者ID:laran,項目名稱:spring-data-rest-mvc-react,代碼行數:13,代碼來源:RestMvcConfiguration.java

示例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();
  }
}
 
開發者ID:t1m0,項目名稱:Spring-Examples,代碼行數:11,代碼來源:Application.java

示例14: configureRepositoryRestConfiguration

import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
protected void configureRepositoryRestConfiguration(
        RepositoryRestConfiguration config) {
    super.configureRepositoryRestConfiguration(config);

    config.exposeIdsFor(Employee.class);
}
 
開發者ID:destiny1020,項目名稱:hranalyzer,代碼行數:8,代碼來源:HRAnalyzerRestConfiguration.java

示例15: configureRepositoryRestConfiguration

import org.springframework.data.rest.core.config.RepositoryRestConfiguration; //導入方法依賴的package包/類
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
    config.exposeIdsFor(Movie.class);
}
 
開發者ID:Microsoft,項目名稱:movie-db-java-on-azure,代碼行數:5,代碼來源:DataRepositoryConfiguration.java


注:本文中的org.springframework.data.rest.core.config.RepositoryRestConfiguration.exposeIdsFor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。