2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session

i have one super class and two sub classes. when i use the "hierarchy" mapping of relation, it shows this error.

 public class Employee {

}

public class Dept extends Employee{

}

public class College extends Employee{

}


when i did mapping both sub classes, i got this type of error. But i haven"t got any error when i mapped one super class and one sub class

org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session

Answer is