I have my existing @NodeEntity as below
@NodeEntity
public class Company {
@GraphId
private Long id;
private String name;
private String blah;
and the @Repository
@Repository
public interface CompanyRepository extends GraphRepository<Company> {
Company findByName(String name);
To create a new Company in neo4j, simply do
Company company = new Company();
company.setName("Company Name");
repository.save(company);
This will create a Company node in neo4j with Label Company.
However, I also want to be able create this with a different label. Instead of creating a new @NodeEntity and a new @Repository, can I use existing domain and repo with a separate label to do it?
I had google this, most answers are only applied to SDN 3.*. Some of those suggest to have a collection field annotate with @Labels, but looks like this @Labels has been removed from SDN4.0