Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REQUIRE_EXPLICIT_LAZY_LOADING_MARKER not working #91

Open
LukaszZu opened this issue Jun 1, 2016 · 1 comment
Open

REQUIRE_EXPLICIT_LAZY_LOADING_MARKER not working #91

LukaszZu opened this issue Jun 1, 2016 · 1 comment

Comments

@LukaszZu
Copy link

LukaszZu commented Jun 1, 2016

Hi

When I create configuration in spring boot

@Configuration
public class JacksonConfiguration {

    @Bean
    public Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder() {
        Jackson2ObjectMapperBuilder mapperBuilder = new Jackson2ObjectMapperBuilder();
        Hibernate5Module hibernate5Module = new Hibernate5Module();
        hibernate5Module.configure(Hibernate5Module.Feature.REQUIRE_EXPLICIT_LAZY_LOADING_MARKER, true);
        mapperBuilder.modules(hibernate5Module);
        return mapperBuilder;
    }
}

and mark field in Entity

@ManyToMany(fetch = FetchType.LAZY)
    private Set<SomeEntity> authorities = new HashSet<>();

With this settings true I expected that when I mark my Relation as FetchType.LAZY then jackson will not try to fetch it but other not marked will be fetched as before module added.
Maybe I'm wrong then please correct me.

But whether this configuration is enabled or not there is not change and relations are not fetched.

@cowtowncoder
Copy link
Member

A stand-alone unit test would be nice to reproduce this outside of Spring Boot container. Also, version used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants