-->
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.  [ 2 posts ] 
Author Message
 Post subject: Is Hibernate -OGM does not supports InheritanceType.JOINED?
PostPosted: Fri Nov 25, 2016 4:56 am 
Newbie

Joined: Thu Nov 24, 2016 7:57 am
Posts: 1
i am migrating application mysql database to mongodb using hibernate-ogm. In my pojo class i used InheritanceType.JOINED. its giving following error. in hibernate its working fine for me. In hibernate-ogm its givving error. hibernate-OGM official document i read "Hibernate OGM supports the following inheritance strategies: * InheritanceType.TABLE_PER_CLASS * InheritanceType.SINGLE_TABLE " only.

Code:
Caused by: java.lang.UnsupportedOperationException: Joined subclasses   strategy not supported
at org.hibernate.ogm.jpa.impl.OgmPersisterClassResolver.joinedSubclassEntityPersister(OgmPersisterClassResolver.java:32)


same question i posted in stackoverflow http://stackoverflow.com/questions/40779297/is-hibernate-ogm-does-not-supports-inheritancetype-joined

My pojo class is

Code:
/**
* For add new Resource.
*
* @author Suman Behara
* @version 1
* @since 1
*
*/
    @Entity
    @Table(name = "resource")
    @Inheritance(strategy = InheritanceType.JOINED)
    @AttributeOverride(name = "id", column= @Column(name = "resourceId"))
    public class Resource extends BaseEntity implements Serializable {
    @Column(name = "resourceName", nullable = false, unique = true)
    private String resourceName;
    private String organization;
    private String contactPersonName;
    private String designation;
    private String address;
    private String email;
    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getOrganization() {
        return organization;
    }

    public void setOrganization(String organization) {
        this.organization = organization;
    }

    public String getContactPersonName() {
        return contactPersonName;
    }

    public void setContactPersonName(String contactPersonName) {
        this.contactPersonName = contactPersonName;
    }

    public String getDesignation() {
        return designation;
    }

    public void setDesignation(String designation) {
        this.designation = designation;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
   }


Code:
/**
* For add new Meta-data Resource.
*
* @author Suman Behara
* @version 1
* @since 1
*
*/
@Entity
@Table(name ="metadata")
@PrimaryKeyJoinColumn(name = "resourceId")
public class Metadata extends Resource implements Serializable {
@Column(name = "contentWithMetadata", columnDefinition = "bit(1)")
    private boolean contentWithMetadata;
    @Column(name = "childResourceName", nullable = false, unique = true)
    private String childResourceName;

    private String parentResourceName;
    @Column(name = "childResourceId", nullable = false, unique = true)
    private String childResourceId;

    private String parentResourceId;
     public String getChildResourceName() {
        return childResourceName;
    }

    public void setChildResourceName(String childResourceName) {
        this.childResourceName = childResourceName;
    }

    public String getParentResourceName() {
        return parentResourceName;
    }

    public void setParentResourceName(String parentResourceName) {
        this.parentResourceName = parentResourceName;
    }

    public String getChildResourceId() {
        return childResourceId;
    }

    public void setChildResourceId(String childResourceId) {
        this.childResourceId = childResourceId;
    }

    public String getParentResourceId() {
        return parentResourceId;
    }

    public void setParentResourceId(String parentResourceId) {
        this.parentResourceId = parentResourceId;
    }

    public boolean isContentWithMetadata() {
        return contentWithMetadata;
    }

    public void setContentWithMetadata(boolean contentWithMetadata) {
        this.contentWithMetadata = contentWithMetadata;
    }
}


Top
 Profile  
 
 Post subject: Re: Is Hibernate -OGM does not supports InheritanceType.JOINED?
PostPosted: Fri Feb 03, 2017 7:05 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hibernate OGM does not support the JOINED approach, mainly because it requires JOIN queries that are not ideal with that model.

I hope this help,
Davide


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

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.