Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » MappedSuperClass
MappedSuperClass [message #82989] |
Thu, 10 May 2007 13:55 |
Eclipse User |
|
|
|
Originally posted by: cn.arcsolutions.de
Hello,
My hierarchy is simplified like this:
Class A
Subclass B(from A)
Subclass C (from B)
Subclass D (from B)
My Question is: can I map class B with TABLE_PER_CLASS? I've tried it with the teneo annotation and get an exception, that the column e_id (normally saved under class A) is unknown (to C, I think).
By the way: I try this break of hierarchy to speedup my db-model. Is an performance increase possible?
thanks
cn
|
|
| |
Re: MappedSuperClass [message #83020 is a reply to message #83005] |
Thu, 10 May 2007 14:28 |
Eclipse User |
|
|
|
Originally posted by: cn.arcsolutions.de
Sorry my mistake. I would like to map class C with TABLE_PER_CLASS.
I've tested it with @MappedSuperclass on B but then I get an SAXParserExcpetion instead.
|
|
| |
Re: MappedSuperClass [message #83050 is a reply to message #83034] |
Thu, 10 May 2007 15:01 |
Eclipse User |
|
|
|
Originally posted by: cn.arcsolutions.de
My annotation is just @MappedSuperclass on B and @Inheritance(strategy=TABLE_PER_CLASS) on C and D.
well I can't set the annotation to A because it is referenced by other classes (B isn't).
Caused by: org.xml.sax.SAXParseException: The content of element type "class" must match " (meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id |composite-id),discriminator?,natural-id?,(version|timestamp )?,(property|many-to-one|one-to-one|component|dynamic-compon ent|properties|any|map|set|list|bag|idbag|array|primitive-ar ray)*,((join*,subclass*)|joined-subclass*|union-subclass*),l oader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset *,(query|sql-query)*) ".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseExc eption(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement( Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknow n Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndEleme nt(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.dom4j.io.SAXReader.read(SAXReader.java:365)
at org.hibernate.cfg.Configuration.addXML(Configuration.java:43 6)
.... 61 more
|
|
|
Re: MappedSuperClass [message #83064 is a reply to message #83050] |
Thu, 10 May 2007 15:12 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
In general Hibernate does not allow mixing different inheritance approaches in one inheritance
structure. You can put table-per-class on A though.
Teneo only supports the inheritancestrategy on the root of the inheritance structure (ignoring
mappedsuperclass and transient types).
gr. Martin
Christian Neudert wrote:
> My annotation is just @MappedSuperclass on B and
> @Inheritance(strategy=TABLE_PER_CLASS) on C and D.
> well I can't set the annotation to A because it is referenced by other
> classes (B isn't).
>
> Caused by: org.xml.sax.SAXParseException: The content of element type
> "class" must match
> " (meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id |composite-id),discriminator?,natural-id?,(version|timestamp )?,(property|many-to-one|one-to-one|component|dynamic-compon ent|properties|any|map|set|list|bag|idbag|array|primitive-ar ray)*,((join*,subclass*)|joined-subclass*|union-subclass*),l oader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset *,(query|sql-query)*) ".
>
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseExc eption(Unknown
> Source)
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement( Unknown
> Source)
> at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknow n Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndEleme nt(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.dom4j.io.SAXReader.read(SAXReader.java:465)
> at org.dom4j.io.SAXReader.read(SAXReader.java:365)
> at org.hibernate.cfg.Configuration.addXML(Configuration.java:43 6)
> .... 61 more
>
>
--
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: MappedSuperClass [message #83079 is a reply to message #83050] |
Thu, 10 May 2007 15:22 |
Eclipse User |
|
|
|
Originally posted by: cn.arcsolutions.de
Thanks for the quick response!
So i got to live with it. By the way, would there be a performance increasement if I could "cut of" A completely? Now from A to C all classes are joined.
I think this should cut the db-select by one table and make it faster!
cn
|
|
| |
Re: MappedSuperClass [message #83114 is a reply to message #83094] |
Thu, 10 May 2007 15:48 |
Eclipse User |
|
|
|
Originally posted by: cn.arcsolutions.de
Hi,
Well as you said, "It all depends" how many parts are loaded to db.
Nearly all my classes are sublasses of A so at the moment i think normal values are:
for A around 100000
for B around 90000
for C around 10000
Normal UseCase: read one time (but only around 2%).
bye
Christian
Martin Taal schrieb:
> Hi Christian,
> It all depends...
> Just for my curiosity how many records will there be in A, B and C and
> how often are you reading them?
|
|
| | | |
Re: MappedSuperClass [message #606666 is a reply to message #83034] |
Thu, 10 May 2007 15:01 |
Christian Neudert Messages: 13 Registered: July 2009 |
Junior Member |
|
|
My annotation is just @MappedSuperclass on B and @Inheritance(strategy=TABLE_PER_CLASS) on C and D.
well I can't set the annotation to A because it is referenced by other classes (B isn't).
Caused by: org.xml.sax.SAXParseException: The content of element type "class" must match " (meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id |composite-id),discriminator?,natural-id?,(version|timestamp )?,(property|many-to-one|one-to-one|component|dynamic-compon ent|properties|any|map|set|list|bag|idbag|array|primitive-ar ray)*,((join*,subclass*)|joined-subclass*|union-subclass*),l oader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset *,(query|sql-query)*) ".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseExc eption(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement( Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknow n Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndEleme nt(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.dom4j.io.SAXReader.read(SAXReader.java:365)
at org.hibernate.cfg.Configuration.addXML(Configuration.java:43 6)
.... 61 more
|
|
|
Re: MappedSuperClass [message #606667 is a reply to message #83050] |
Thu, 10 May 2007 15:12 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
In general Hibernate does not allow mixing different inheritance approaches in one inheritance
structure. You can put table-per-class on A though.
Teneo only supports the inheritancestrategy on the root of the inheritance structure (ignoring
mappedsuperclass and transient types).
gr. Martin
Christian Neudert wrote:
> My annotation is just @MappedSuperclass on B and
> @Inheritance(strategy=TABLE_PER_CLASS) on C and D.
> well I can't set the annotation to A because it is referenced by other
> classes (B isn't).
>
> Caused by: org.xml.sax.SAXParseException: The content of element type
> "class" must match
> " (meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id |composite-id),discriminator?,natural-id?,(version|timestamp )?,(property|many-to-one|one-to-one|component|dynamic-compon ent|properties|any|map|set|list|bag|idbag|array|primitive-ar ray)*,((join*,subclass*)|joined-subclass*|union-subclass*),l oader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset *,(query|sql-query)*) ".
>
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseExc eption(Unknown
> Source)
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement( Unknown
> Source)
> at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknow n Source)
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndEleme nt(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragme ntContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDo cument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.dom4j.io.SAXReader.read(SAXReader.java:465)
> at org.dom4j.io.SAXReader.read(SAXReader.java:365)
> at org.hibernate.cfg.Configuration.addXML(Configuration.java:43 6)
> .... 61 more
>
>
--
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
|
|
| | | |
Goto Forum:
Current Time: Sat Oct 19 15:41:33 GMT 2024
Powered by FUDForum. Page generated in 0.05956 seconds
|