Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] When are Entities Equal?

I've got an entity with a many to one, let's call it employees, with a
department.

So my employee entity has a Department field.

If I'm in the same Entity Manager and I do a find on an Employee to
get an instance of a specific Employee Entity, then later in the same
EM I do a select all on departments, my list of departments now
contains a reference to the same Department that my Employee entity
references.

This is really great for doing things like databinding on drop down
lists, because I can bind the list of departments directly to the
department on my employee entity.

However, is this safe? Can I count on these being the _same_ entities;
not just entities with the same field values all the time? What's
eclipselink doing behind the scenes?

Thanks,
Tim


Back to the top