Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [Teneo] Can't seem to access objects in store
[Teneo] Can't seem to access objects in store [message #72726] |
Fri, 23 February 2007 13:49  |
Eclipse User |
|
|
|
I am not able to access objects in a Teneo data store. I have browsed the
database and the object data is there. After doing a load on the resource
I only seem to have the root object. If I try to access objects contained
by the root I get an object of type HibernatePersistableEList, for example.
Here is the code I run to load the resource...
ResourceSet resSet = new ResourceSetImpl();
Resource res = new HibvernateResource(...uri for .ehb file);
res.load(null);
What is wrong here...?
Thanks,
Mark.
|
|
| | | | | | |
Re: [Teneo] Can't seem to access objects in store [message #72889 is a reply to message #72872] |
Mon, 26 February 2007 17:18   |
Eclipse User |
|
|
|
Martin,
Here are all the entries for 'facility' in both the ecore and mappingXML
file.
Facility is the object I am trying to load/get from the Echostar object.
Echostar is the root object of the store.
############################## mappingXML file entries for 'facility'
<class entity-name="NamedEquipmentList" abstract="false" lazy="false"
discriminator-value="NamedEquipmentList" table="`namedequipmentlist`">
<meta attribute="eclassName">NamedEquipmentList</meta>
<meta attribute="epackage">http://srd</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<list name="namedEquipment" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`namedequipment_namedequipmentlist_id`" not-null="false"
unique="false"/>
</key>
<list-index column="`namedequipmentlist_namedequipment_idx`"/>
<one-to-many entity-name="NamedEquipment"/>
</list>
<one-to-one name="facility" entity-name="Facility"
cascade="merge,persist,save-update,lock,refresh"
property-ref="namedEquipmentList" lazy="false"/>
</class>
<class entity-name="Echostar" abstract="false" lazy="false"
discriminator-value="Echostar" table="`echostar`">
<meta attribute="eclassName">Echostar</meta>
<meta attribute="epackage">http://srd</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<one-to-one name="contactList" entity-name="ContactList" cascade="all"
property-ref="echostar" lazy="false"/>
<many-to-one name="enumAttrList" entity-name="EnumAttrList"
cascade="all" lazy="false" insert="true" update="true" unique="true"/>
<list name="facilities" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`facility_echostar_id`" not-null="false" unique="false"/>
</key>
<list-index column="`echostar_facilities_idx`"/>
<one-to-many entity-name="Facility"/>
</list>
</class>
<class entity-name="AbstractServiceGroup" abstract="false" lazy="false"
discriminator-value="AbstractServiceGroup" table="`abstractservicegroup`">
<meta attribute="eclassName">AbstractServiceGroup</meta>
<meta attribute="epackage">http://srd</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<many-to-one name="facility" entity-name="Facility"
cascade="merge,persist,save-update,lock,refresh" lazy="false"
insert="false" update="false" not-null="false">
<column not-null="false" unique="false"
name="`abstractservicegroup_facility_id`"/>
</many-to-one>
</class>
<class entity-name="Facility" abstract="false" lazy="false"
discriminator-value="Facility" table="`facility`">
<meta attribute="eclassName">Facility</meta>
<meta attribute="epackage">http://srd</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<property name="description" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`description`"/>
</property>
<property name="name" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`name`"/>
</property>
<many-to-one name="echostar" entity-name="Echostar"
cascade="merge,persist,save-update,lock,refresh" lazy="false"
insert="false" update="false" not-null="false">
<column not-null="false" unique="false" name="`facility_echostar_id`"/>
</many-to-one>
<many-to-one name="namedEquipmentList" entity-name="NamedEquipmentList"
cascade="all" lazy="false" insert="true" update="true" unique="true"/>
<list name="groups" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`abstractservicegroup_facility_id`" not-null="false"
unique="false"/>
</key>
<list-index column="`facility_groups_idx`"/>
<one-to-many entity-name="AbstractServiceGroup"/>
</list>
</class>
############################## ecore file entries for 'facility'
<eClassifiers xsi:type="ecore:EClass" name="NamedEquipmentList">
<eStructuralFeatures xsi:type="ecore:EReference" name="namedEquipment"
upperBound="-1"
eType="#//NamedEquipment" containment="true"
eOpposite="#//NamedEquipment/namedEquipmentList"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="facility"
lowerBound="1"
eType="#//Facility" eOpposite="#//Facility/namedEquipmentList"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Echostar">
<eStructuralFeatures xsi:type="ecore:EReference" name="contactList"
eType="#//ContactList"
containment="true" eOpposite="#//ContactList/echostar"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="enumAttrList"
lowerBound="1"
eType="#//EnumAttrList" containment="true"
eOpposite="#//EnumAttrList/echostar"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="facilities"
upperBound="-1"
eType="#//Facility" containment="true"
eOpposite="#//Facility/echostar"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Facility">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="echostar"
lowerBound="1"
eType="#//Echostar" eOpposite="#//Echostar/facilities"/>
<eStructuralFeatures xsi:type="ecore:EReference"
name="namedEquipmentList" lowerBound="1"
eType="#//NamedEquipmentList" containment="true"
eOpposite="#//NamedEquipmentList/facility"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="groups"
upperBound="-1"
eType="#//AbstractServiceGroup" containment="true"
eOpposite="#//AbstractServiceGroup/facility"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractServiceGroup">
<eStructuralFeatures xsi:type="ecore:EReference" name="facility"
lowerBound="1"
eType="#//Facility" eOpposite="#//Facility/groups"/>
</eClassifiers>
|
|
| | |
Re: [Teneo] RESOLVED:Can't seem to access objects in store [message #72963 is a reply to message #72924] |
Tue, 27 February 2007 11:49  |
Eclipse User |
|
|
|
Martin,
I started looking at the differences between the windows and linux
machines and found that the version of Teneo was different. On the windows
box I was running 0.7.5, and on the Linux box 0.8.0. I have upgraded the
windows box to 0.8.0 and it works like the Linux box.
I am sorry for the waste of time...
Mark.
|
|
|
Re: [Teneo] Can't seem to access objects in store [message #602929 is a reply to message #72726] |
Sat, 24 February 2007 02:08  |
Eclipse User |
|
|
|
Mark,
Yes this is the Teneo EList implementation. Does the elist contain the contained objects?
gr. Martin
Mark wrote:
> I am not able to access objects in a Teneo data store. I have browsed
> the database and the object data is there. After doing a load on the
> resource I only seem to have the root object. If I try to access objects
> contained by the root I get an object of type HibernatePersistableEList,
> for example.
>
> Here is the code I run to load the resource...
>
> ResourceSet resSet = new ResourceSetImpl();
> Resource res = new HibvernateResource(...uri for .ehb file);
> res.load(null);
>
> What is wrong here...?
>
> Thanks,
> Mark.
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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
|
|
| |
Re: [Teneo] Can't seem to access objects in store [message #602938 is a reply to message #72778] |
Sun, 25 February 2007 10:12  |
Eclipse User |
|
|
|
Mark,
The lists are normally lazily loaded. So they are empty until you access them explicitly (for
example by doing size()).
You need to debug into the load method of the HibernatePersistableEList to see what is happening.
Also the log will provide a fair amount of detail.
gr. Martin
Mark wrote:
> Martin,
>
> No, all of the ...Elists are emtpy.
>
> Mark.
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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
|
|
| |
Re: [Teneo] Can't seem to access objects in store [message #602949 is a reply to message #72806] |
Mon, 26 February 2007 13:29  |
Eclipse User |
|
|
|
Martin,
I am running now with debugging on and and see that when I call .load() on
the resource that it looks like the entire resource is loaded...it has run
for more than 15 minutes. I see objects with attribute values, etc. in the
debug output.
I have stepped into the doLoad() method and see that a call to
delagate.toArray() returns an empty array for the object I have been
trying to load.
If it would help I can send you the debug output, but it is HUGE!!
Mark.
|
|
|
Re: [Teneo] Can't seem to access objects in store [message #602952 is a reply to message #72855] |
Mon, 26 February 2007 13:58  |
Eclipse User |
|
|
|
Mark,
If possible can you focus on one such empty elist and then check the model and the mapping hbm
(getMappingXML on the HbDataStore) for that relation? Can you post this part of the model and the
part of the mapping xml?
Can you check if for that association the data in the database is correct (the foreign keys are set)?
gr. Martin
Mark wrote:
> Martin,
>
> I am running now with debugging on and and see that when I call .load()
> on the resource that it looks like the entire resource is loaded...it
> has run for more than 15 minutes. I see objects with attribute values,
> etc. in the debug output.
>
> I have stepped into the doLoad() method and see that a call to
> delagate.toArray() returns an empty array for the object I have been
> trying to load.
>
> If it would help I can send you the debug output, but it is HUGE!!
>
> Mark.
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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
|
|
|
Re: [Teneo] Can't seem to access objects in store [message #602954 is a reply to message #72872] |
Mon, 26 February 2007 17:18  |
Eclipse User |
|
|
|
Martin,
Here are all the entries for 'facility' in both the ecore and mappingXML
file.
Facility is the object I am trying to load/get from the Echostar object.
Echostar is the root object of the store.
############################## mappingXML file entries for 'facility'
<class entity-name="NamedEquipmentList" abstract="false" lazy="false"
discriminator-value="NamedEquipmentList" table="`namedequipmentlist`">
<meta attribute="eclassName">NamedEquipmentList</meta>
<meta attribute="epackage">http://srd</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<list name="namedEquipment" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`namedequipment_namedequipmentlist_id`" not-null="false"
unique="false"/>
</key>
<list-index column="`namedequipmentlist_namedequipment_idx`"/>
<one-to-many entity-name="NamedEquipment"/>
</list>
<one-to-one name="facility" entity-name="Facility"
cascade="merge,persist,save-update,lock,refresh"
property-ref="namedEquipmentList" lazy="false"/>
</class>
<class entity-name="Echostar" abstract="false" lazy="false"
discriminator-value="Echostar" table="`echostar`">
<meta attribute="eclassName">Echostar</meta>
<meta attribute="epackage">http://srd</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<one-to-one name="contactList" entity-name="ContactList" cascade="all"
property-ref="echostar" lazy="false"/>
<many-to-one name="enumAttrList" entity-name="EnumAttrList"
cascade="all" lazy="false" insert="true" update="true" unique="true"/>
<list name="facilities" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`facility_echostar_id`" not-null="false" unique="false"/>
</key>
<list-index column="`echostar_facilities_idx`"/>
<one-to-many entity-name="Facility"/>
</list>
</class>
<class entity-name="AbstractServiceGroup" abstract="false" lazy="false"
discriminator-value="AbstractServiceGroup" table="`abstractservicegroup`">
<meta attribute="eclassName">AbstractServiceGroup</meta>
<meta attribute="epackage">http://srd</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<many-to-one name="facility" entity-name="Facility"
cascade="merge,persist,save-update,lock,refresh" lazy="false"
insert="false" update="false" not-null="false">
<column not-null="false" unique="false"
name="`abstractservicegroup_facility_id`"/>
</many-to-one>
</class>
<class entity-name="Facility" abstract="false" lazy="false"
discriminator-value="Facility" table="`facility`">
<meta attribute="eclassName">Facility</meta>
<meta attribute="epackage">http://srd</meta>
<id type="long" name="e_id" column="e_id"
access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
<meta attribute="syntheticId">true</meta>
<generator class="native"/>
</id>
<discriminator column="`dtype`" type="string"/>
<version name="e_version" column="e_version"
access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
<meta attribute="syntheticVersion">true</meta>
</version>
<property name="description" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`description`"/>
</property>
<property name="name" lazy="false" insert="true" update="true"
not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`name`"/>
</property>
<many-to-one name="echostar" entity-name="Echostar"
cascade="merge,persist,save-update,lock,refresh" lazy="false"
insert="false" update="false" not-null="false">
<column not-null="false" unique="false" name="`facility_echostar_id`"/>
</many-to-one>
<many-to-one name="namedEquipmentList" entity-name="NamedEquipmentList"
cascade="all" lazy="false" insert="true" update="true" unique="true"/>
<list name="groups" lazy="true" cascade="all,delete-orphan">
<key update="true">
<column name="`abstractservicegroup_facility_id`" not-null="false"
unique="false"/>
</key>
<list-index column="`facility_groups_idx`"/>
<one-to-many entity-name="AbstractServiceGroup"/>
</list>
</class>
############################## ecore file entries for 'facility'
<eClassifiers xsi:type="ecore:EClass" name="NamedEquipmentList">
<eStructuralFeatures xsi:type="ecore:EReference" name="namedEquipment"
upperBound="-1"
eType="#//NamedEquipment" containment="true"
eOpposite="#//NamedEquipment/namedEquipmentList"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="facility"
lowerBound="1"
eType="#//Facility" eOpposite="#//Facility/namedEquipmentList"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Echostar">
<eStructuralFeatures xsi:type="ecore:EReference" name="contactList"
eType="#//ContactList"
containment="true" eOpposite="#//ContactList/echostar"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="enumAttrList"
lowerBound="1"
eType="#//EnumAttrList" containment="true"
eOpposite="#//EnumAttrList/echostar"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="facilities"
upperBound="-1"
eType="#//Facility" containment="true"
eOpposite="#//Facility/echostar"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Facility">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="echostar"
lowerBound="1"
eType="#//Echostar" eOpposite="#//Echostar/facilities"/>
<eStructuralFeatures xsi:type="ecore:EReference"
name="namedEquipmentList" lowerBound="1"
eType="#//NamedEquipmentList" containment="true"
eOpposite="#//NamedEquipmentList/facility"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="groups"
upperBound="-1"
eType="#//AbstractServiceGroup" containment="true"
eOpposite="#//AbstractServiceGroup/facility"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="AbstractServiceGroup">
<eStructuralFeatures xsi:type="ecore:EReference" name="facility"
lowerBound="1"
eType="#//Facility" eOpposite="#//Facility/groups"/>
</eClassifiers>
|
|
|
Re: [Teneo] Can't seem to access objects in store [message #602957 is a reply to message #72872] |
Mon, 26 February 2007 18:49  |
Eclipse User |
|
|
|
Martin,
Please ignore my other post.
This appears to be a issue with windows vs linux.
I once again moved everthing to a Linux box and everything seems to work,
that is the loading of the object I was having trouble with.
I'm not sure what this means, maybe more to you than me...
I am running the same mysql driver on both the windows and linux machines.
Anything else that is OS specific here.?
Mark.
|
|
|
Re: [Teneo] Can't seem to access objects in store [message #602961 is a reply to message #72906] |
Tue, 27 February 2007 03:24  |
Eclipse User |
|
|
|
Mark,
No Teneo does not have any os specific code/handling.
Is it possible that this worked because you started with a new empty database (no tables) on Linux?
gr. Martin
Mark wrote:
> Martin,
>
> Please ignore my other post.
>
> This appears to be a issue with windows vs linux.
>
> I once again moved everthing to a Linux box and everything seems to
> work, that is the loading of the object I was having trouble with.
>
> I'm not sure what this means, maybe more to you than me...
>
> I am running the same mysql driver on both the windows and linux machines.
>
> Anything else that is OS specific here.?
>
> Mark.
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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
|
|
|
Re: [Teneo] RESOLVED:Can't seem to access objects in store [message #602971 is a reply to message #72924] |
Tue, 27 February 2007 11:49  |
Eclipse User |
|
|
|
Martin,
I started looking at the differences between the windows and linux
machines and found that the version of Teneo was different. On the windows
box I was running 0.7.5, and on the Linux box 0.8.0. I have upgraded the
windows box to 0.8.0 and it works like the Linux box.
I am sorry for the waste of time...
Mark.
|
|
|
Goto Forum:
Current Time: Sun Jul 06 15:46:18 EDT 2025
Powered by FUDForum. Page generated in 0.28694 seconds
|