package com.justjournal.config;

import com.justjournal.model.*;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration;

/**
 * Expose ids for some classes
 * @author Lucas Holt
 */
@Configuration
public class JustJournalRepositoryRestConfiguration extends RepositoryRestMvcConfiguration {

    /** {@inheritDoc} */
    @Override
    protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
        super.configureRepositoryRestConfiguration(config);

        config.exposeIdsFor(Comment.class);
        config.exposeIdsFor(Entry.class);
        config.exposeIdsFor(Mood.class);
        config.exposeIdsFor(Location.class);
        config.exposeIdsFor(Security.class);

    }
}
package com.justjournal.config;

import com.justjournal.model.*;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurerAdapter;

/**
 * Expose ids for some classes
 *
 * @author Lucas Holt
 */
@Configuration
public class JustJournalRepositoryRestConfiguration extends RepositoryRestConfigurerAdapter {

    @Override
    public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {

        config.exposeIdsFor(Comment.class, Entry.class, Mood.class, Location.class, Security.class);
    }
}
switch to modern version so we don't get deprecated warnings