Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [teneo] UUID with containment causes "no String constructor" exception on retrieval
[teneo] UUID with containment causes "no String constructor" exception on retrieval [message #661800] Sun, 27 March 2011 23:31 Go to next message
Marek V is currently offline Marek VFriend
Messages: 3
Registered: February 2011
Junior Member
Hi,

I assume I'm doing something wrong, as it looks like Teneo won't work with containment using UUID ids (or any other ID type which doesn't have a String constructor).

I get the following exception on retrieval:

28-Mar-2011 00:05:03 org.eclipse.emf.teneo.TeneoException <init>
SEVERE: Class java.util.UUID does not have a constructor with a String parameter!
org.eclipse.emf.teneo.hibernate.HbMapperException: Class java.util.UUID does not have a constructor with a String parameter!
at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.extractID(EContainerUserType.java:48
5)
at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.nullSafeGet(EContainerUserType.java:
385)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
at org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)

I have created a simple standalone test showing this. The test has an EMF interface called Master with a UUID id which. Master has a containment reference to a List<Detail>. Each Detail has a UUID id.

With such a set up I can save a new Master with Detail, but when I try to retrieve the new Master and Detail I get the exception above.

In the detail table, teneo has added a column E_CONTAINER which refers to its container and contains the String "java.util.UUID;390dea26-b149-45e5-99ab-40152e24cc8d".

So what am I doing wrong as surely Teneo with Hibernate can work with UUID id objects?

Any help much appreciated! Thanks,

Marek

My EMF interfaces:
/**
* @model
*/
public interface Master extends EObject {

/**
* @model id="true"
*/
public UUID getId();

/**
* Sets the value of the '{@link samples.teneo.uuid.domain.Master#getId <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Id</em>' attribute.
* @see #getId()
* @generated
*/
void setId(UUID value);

/**
* @model containment="true"
* @return
*/
public EList<Detail> getDetails();

}

/**
* @model
*/
public interface Detail extends EObject {


/**
* @model id="true"
*/
public UUID getId();

/**
* Sets the value of the '{@link samples.teneo.uuid.domain.Detail#getId <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Id</em>' attribute.
* @see #getId()
* @generated
*/
void setId(UUID value);

/**
* @model
* @return
*/
public String getValue();

/**
* Sets the value of the '{@link samples.teneo.uuid.domain.Detail#getValue <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Value</em>' attribute.
* @see #getValue()
* @generated
*/
void setValue(String value);

}

Re: [teneo] UUID with containment causes "no String constructor" exception on retrieval [message #662008 is a reply to message #661800] Mon, 28 March 2011 20:41 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Marek,
This seems to be a missing feature or not handled correctly. Can you enter a bugzilla for this?

gr. Martin

On 03/28/2011 01:31 AM, Marek V wrote:
> Hi,
>
> I assume I'm doing something wrong, as it looks like Teneo won't work with containment using UUID ids (or any other ID
> type which doesn't have a String constructor).
>
> I get the following exception on retrieval:
>
> 28-Mar-2011 00:05:03 org.eclipse.emf.teneo.TeneoException <init>
> SEVERE: Class java.util.UUID does not have a constructor with a String parameter!
> org.eclipse.emf.teneo.hibernate.HbMapperException: Class java.util.UUID does not have a constructor with a String
> parameter!
> at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.extractID(EContainerUserType.java:48
> 5)
> at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContaine rUserType.nullSafeGet(EContainerUserType.java:
> 385)
> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:10 4)
> at org.hibernate.persister.entity.AbstractEntityPersister.hydra te(AbstractEntityPersister.java:2265)
> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:15 27)
>
> I have created a simple standalone test showing this. The test has an EMF interface called Master with a UUID id which.
> Master has a containment reference to a List<Detail>. Each Detail has a UUID id.
>
> With such a set up I can save a new Master with Detail, but when I try to retrieve the new Master and Detail I get the
> exception above.
>
> In the detail table, teneo has added a column E_CONTAINER which refers to its container and contains the String
> "java.util.UUID;390dea26-b149-45e5-99ab-40152e24cc8d".
>
> So what am I doing wrong as surely Teneo with Hibernate can work with UUID id objects?
>
> Any help much appreciated! Thanks,
>
> Marek
>
> My EMF interfaces:
> /**
> * @model
> */
> public interface Master extends EObject {
>
> /**
> * @model id="true"
> */
> public UUID getId();
>
> /**
> * Sets the value of the '{@link samples.teneo.uuid.domain.Master#getId <em>Id</em>}' attribute.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @param value the new value of the '<em>Id</em>' attribute.
> * @see #getId()
> * @generated
> */
> void setId(UUID value);
>
> /**
> * @model containment="true"
> * @return
> */
> public EList<Detail> getDetails();
>
> }
>
> /**
> * @model
> */
> public interface Detail extends EObject {
>
>
> /**
> * @model id="true"
> */
> public UUID getId();
>
> /**
> * Sets the value of the '{@link samples.teneo.uuid.domain.Detail#getId <em>Id</em>}' attribute.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @param value the new value of the '<em>Id</em>' attribute.
> * @see #getId()
> * @generated
> */
> void setId(UUID value);
>
> /**
> * @model
> * @return
> */
> public String getValue();
>
> /**
> * Sets the value of the '{@link samples.teneo.uuid.domain.Detail#getValue <em>Value</em>}' attribute.
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @param value the new value of the '<em>Value</em>' attribute.
> * @see #getValue()
> * @generated
> */
> void setValue(String value);
>
> }
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:EList of Double may not contain nulls? [CDO]
Next Topic:EMF load resource with different namespaces (prefixes)
Goto Forum:
  


Current Time: Fri Apr 26 08:55:27 GMT 2024

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

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

Back to the top