Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo: problems with HibernatePersistableEList.equal(Object)
Teneo: problems with HibernatePersistableEList.equal(Object) [message #596497] Tue, 05 December 2006 07:57
Ilya Klyuchnikov is currently offline Ilya KlyuchnikovFriend
Messages: 74
Registered: July 2009
Member
Hi all.

When I have some feature in my model which is unordered list it's mapped
as <bag> so in runtime I have HibernatePersistableEList which delegates
to hibernate PersistentBag class. The problem is that PersistantBag
equals() method is:

/**
* Bag does not respect the collection API and do an
* JVM instance comparison to do the equals.
* The semantic is broken not to have to initialize a
* collection for a simple equals() operation.
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object obj) {
return super.equals(obj);
}

So when I try to compare two features which are
HibernatePersistableLists in runtime I get annoying result.

More: HibernatePersistableList delegating to PersistentBag is not equal
to itself. Why? Cause HibernatePersistableList extends DelegatingEList
that has:

public boolean equals(Object object)
{
return delegateEquals(object);
}

protected boolean delegateEquals(Object object)
{
return delegateList().equals(object);
}

Imagine that you have HibernatePersistableList myList.
myList.equals(myList) return always false cause calling to equals
results in comparison

persistentBagDelegate.equals(myList).

BUT HERE IS INSTANCE COMPARISON - SO IT RETURNS FALSE.

Is there any simple workaround or can Teneo implements correct equals()
method in PersistableLists?

Thanks in advance
Previous Topic:teneo - why tables for interfaces?
Next Topic:Teneo - I loose my EObject fields
Goto Forum:
  


Current Time: Sat Apr 27 00:47:02 GMT 2024

Powered by FUDForum. Page generated in 0.02921 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top