cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Auto Relationship break Using Neo4jRepository

Hi All,

I have one model which shown as per Under.

@JsonInclude(Include.NON_NULL)
public class Actor extends AbstractGraphNodeEntity implements IResource {

    @Index
	protected String name;
    
    @Relationship(type = "RESPONSIBLE_ACTOR", direction = Relationship.OUTGOING)
    protected Set<Activity> activitiesResponsibleFor;
    
   

    private String orgGuid;
    
	public Actor() {
        
        this.activitiesResponsibleFor = new HashSet<>();
        //this.activitiesOwnerOf = new HashSet<>();
    }
    
	public String getName() {

		return this.name;
	}

	public void setName(String name) {

		this.name = name;
	}
	
	public Actor addActivityResponsibleFor(final Activity activity) {
	    
	    activity.setResponsibleActor(this);
	    this.activitiesResponsibleFor.add(activity);
	    return this;
	}
	
	public Actor removeActivityResponsibleFor(final Activity activity) {
	    
	    activity.setResponsibleActor(null);
	    this.activitiesResponsibleFor.remove(activity);
	    return this;
	}
	
	public List<Activity> getActivitiesResponsibleFor() {
	     
	    return ImmutableList.copyOf(this.activitiesResponsibleFor);
	}
	

	
	public String getOrgGuid() {
			return orgGuid;
	}

	public void setOrgGuid(String orgGuid) {
			this.orgGuid = orgGuid;
	}

}
public class Person extends Actor {
    
	private String salutation;
	
	@Index
	private String givenName;
	
	@Index
	private String familyName;
	
	private String orgGuid;
	
	@Relationship(type = "CONTACT_INFORMATION", direction = Relationship.OUTGOING)
	private ContactDetails contactInfo;
	
	private String companyName;
	
	public Person() {
	    
		super();
	}

	/**
	 * Gets the given name of this person object. 
	 * 
	 * @return The given name of this person object.
	 */
	public String getGivenName() {
		return this.givenName;
	}

	/**
	 * Sets the given name of this person object.
	 * 
	 * @param givenName The given name to set for this person object
	 */
	public void setGivenName(String givenName) {
		this.givenName = givenName;
		constructAndSetName();
	}

	/**
	 * Gets the family name of this person object
	 * 
	 * @return The family name of this person object.
	 */
	public String getFamilyName() {
		return this.familyName;
	}

	/**
	 * Sets the family name of this person object.
	 * 
	 * @param familyName The family name to set for this person object.
	 */
	public void setFamilyName(String familyName) {
		this.familyName = familyName;
		constructAndSetName();
	}
	
	public String getOrgGuid() {
		return orgGuid;
	}

	public void setOrgGuid(String orgGuid) {
		this.orgGuid = orgGuid;
	}
	
	/**
	 * Gets the salutation for this person object.
	 * 
	 * @return The salutation for this person object.
	 */
	public String getSalutation() {
		return this.salutation;
	}

	/**
	 * Sets the salutation for this person object
	 * 
	 * @param salutation The salutation to set for this person object
	 */
	public void setSalutation(String salutation) {
		this.salutation = salutation;
	}

	public ContactDetails getContactInfo() {
		return contactInfo;
	}

	public void setContactInfo(ContactDetails contactInfo) {
		this.contactInfo = contactInfo;
	}
	
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

I used that above model for user. here CONTACT_INFORMATION removed automatically. I used Neo4jRepository i extends it in a interface class.
but i don't know that why its happening. kindly any one reply me for this issue.

3 REPLIES 3

What do you mean with "removed automatically"? The data gets removed or it ignores the field on saving?

If i was saving Actor node by neo4j ogm i dont know why a CONTACT_INFORMATION relationship was removed.

Could you show me the update code of the application? I assume that there might be a problem with the transaction scope around the loading, manipulating and update call.