-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: help newbie
PostPosted: Tue Jun 19, 2012 6:37 am 
Newbie

Joined: Tue Jun 19, 2012 6:18 am
Posts: 1
I have a pretty trivial example project with 3 entities and 4 tables where one of them have collection relationship of type 'Map <Entity, Basic>'... I don't use annotations but orm.xml... When I start this example I receive errors of kind:
org.hibernate.AnnotationException: No identifier specified for entity: my.missinglink.domain.Management

Can some exeprienced kind person take a look at this, please ? If needed, I have mavenized micro project...

My entity is:

Code:
public class Management extends AbstractEnum {
    protected Management () {
    }
    public Management (final long id, final String description) {
        super(id, description);
    }
}

public abstract class AbstractEnum extends AbstractEntity {
    private String description;

    protected AbstractEnum () {
    }

    public AbstractEnum (final long id, final String description) {
        super(id);
        this.description = description;
    }

    public String getDescription () {
        return description;
    }

    public void setDescription (final String description) {
        this.description = description;
    }
}

public abstract class AbstractEntity implements Serializable {
    private long id;

    public long getId () {
        return id;
    }

    protected AbstractEntity () {
        id = 0;
    }

    public AbstractEntity (final long id) {
        this.id = id;
    }

    @Override
    public boolean equals (final Object object) {
        if (object == null || !(object instanceof AbstractEntity))
            return false;
        return id == ((AbstractEntity) object).id;
    }

    @Override
    public int hashCode () {
        return (int) id;
    }
}


My orm.xml is:

Code:
    <persistence-unit-metadata>
        <xml-mapping-metadata-complete />
        <persistence-unit-defaults>
            <access>FIELD</access>
        </persistence-unit-defaults>
    </persistence-unit-metadata>

    <mapped-superclass class="my.missinglink.domain.AbstractEntity" />

    <mapped-superclass class="my.missinglink.domain.AbstractEnum">
        <attributes>
            <basic name="description">
                <column name="DESCRIPTION" />
            </basic>
        </attributes>
    </mapped-superclass>

    <entity class="my.missinglink.domain.Management">
        <table name="MANAGEMENT" />
        <attributes>
            <id name="id">
                <column name="ID_MANAGEMENT" />
            </id>
        </attributes>
    </entity>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.