Spring Data Neo4j - How to register a node entity and a repository at runtime

196 Views Asked by At

I create a node entity and a repository with using javassist at runtime. And, I want to register them to spring data context. How can I do that?

1

There are 1 best solutions below

1
On

You can have an instance of Neo4jMappingContext injected and then call

ctx.getPersistentEntity(My.class)

This registers the class with the mapping context.

For the repository it has to go to the spring rewiring, not sure about runtime registration there.