Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How to completely ignore annotations for entity mapped with xml?
How to completely ignore annotations for entity mapped with xml? [message #1739346] Sat, 30 July 2016 09:25 Go to next message
Vitaly Gorbunov is currently offline Vitaly GorbunovFriend
Messages: 7
Registered: July 2012
Junior Member
For my project I need few entities to contain only limited set of attributes and completely ignore mapped super classes.

I've added exclude-default-mappings=true and metadata-complete=true to entity mapping, however it still considers annotations from mapped super classes.
Is there a way to fix it?

My xml file example:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<entity-mappings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1" xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm">
    <entity class="com.mycompany.TestCompany" exclude-default-mappings="true" metadata-complete="true" name="TestCompany">
        <table name="COMPANY"/>
        <attributes>
            <id name="uid">
                <generated-value generator="TABLE_GEN" strategy="TABLE"/>
                <column name="COMPANY_ID"/>
            </id>
        </attributes>
    </entity>
</entity-mappings>

[Updated on: Sat, 30 July 2016 09:28]

Report message to a moderator

Re: How to completely ignore annotations for entity mapped with xml? [message #1739518 is a reply to message #1739346] Tue, 02 August 2016 15:46 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1274
Registered: July 2009
Senior Member
How have you named and pointed your persistence unit at this eclipselink-orm.xml file? Try setting logging to Finest and check out the logs to see what EclpseLink is doing during deployment.

[Updated on: Tue, 02 August 2016 15:47]

Report message to a moderator

Re: How to completely ignore annotations for entity mapped with xml? [message #1739538 is a reply to message #1739518] Tue, 02 August 2016 18:15 Go to previous message
Vitaly Gorbunov is currently offline Vitaly GorbunovFriend
Messages: 7
Registered: July 2012
Junior Member
Yes. The point is that I get correct result with entity - only limited set of attributes is mapped, but I still get attributes from mapped super class.

I've added mapped-super-class in xml file as well without any mappings
<mapped-super-class class="com.mycompany.AbstractTestCompany" exclude-default-mappings="true" metadata-complete="true" name="AbstractTestCompany">
 </mapped-super-class>


It was enough for my task.
Previous Topic:EclipseLInk level 2 caching
Next Topic:[Moxy Jersey] NLP at org.eclipse.persistence.jaxb.rs.MOXyJsonProvider.writeTo(MOXyJsonProvider.java:
Goto Forum:
  


Current Time: Mon Dec 11 15:33:43 GMT 2017

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

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