Mapped-superclass persisting only few columns of Parent class


#1

Hello,

I don’t have access to source of Parent class. So I have chosen XML configuration.
Parent class name: LineItem (from admanager package)
Child class name: LineItemCustom

I want to persist parent class attributes inside child class’ table. So I went with “mapped-superclass”.
Astonishingly, only two fields from the Parent class is persisting. In my case, “creativeTargetings” and “targeting” are Persisting from LineItem class (Parent).

I tried the same mapping with “Event” and “ExtendedEvent” classes for testing purpose. It’s working fine. I’m even getting of “id” field of parent. But only in case of “LineItemCustom”, all fields are not persisting.

Can anyone point out what’s wrong here.

**Update:**
**LineItem.java**
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * LineItem.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.admanager.axis.v201808;


/**
 * {@code LineItem} is an advertiser's commitment to purchase a specific
 * number
 *             of ad impressions, clicks, or time.
 */
public class LineItem  extends com.google.api.ads.admanager.axis.v201808.LineItemSummary  implements java.io.Serializable {
    /* Contains the targeting criteria for the ad campaign. This attribute
     * is
     *                     required. */
    private com.google.api.ads.admanager.axis.v201808.Targeting targeting;

    /* A list of {@link CreativeTargeting} objects that can be used
     * to specify creative level
     *                     targeting for this line item. Creative level targeting
     * is specified in a creative placeholder's
     *                     {@link CreativePlaceholder#targetingName} field
     * by referencing the creative targeting's
     *                     {@link CreativeTargeting#name name}. It also needs
     * to be re-specified in the
     *                     {@link LineItemCreativeAssociation#targetingName}
     * field when associating a line item with a
     *                     creative that fits into that placeholder. */
    private com.google.api.ads.admanager.axis.v201808.CreativeTargeting[] creativeTargetings;

    public LineItem() {
    }

    public LineItem(
           java.lang.Long orderId,
           java.lang.Long id,
           java.lang.String name,
           java.lang.String externalId,
           java.lang.String orderName,
           com.google.api.ads.admanager.axis.v201808.DateTime startDateTime,
           com.google.api.ads.admanager.axis.v201808.StartDateTimeType startDateTimeType,
           com.google.api.ads.admanager.axis.v201808.DateTime endDateTime,
           java.lang.Integer autoExtensionDays,
           java.lang.Boolean unlimitedEndDateTime,
           com.google.api.ads.admanager.axis.v201808.CreativeRotationType creativeRotationType,
           com.google.api.ads.admanager.axis.v201808.DeliveryRateType deliveryRateType,
           com.google.api.ads.admanager.axis.v201808.RoadblockingType roadblockingType,
           com.google.api.ads.admanager.axis.v201808.FrequencyCap[] frequencyCaps,
           com.google.api.ads.admanager.axis.v201808.LineItemType lineItemType,
           java.lang.Integer priority,
           com.google.api.ads.admanager.axis.v201808.Money costPerUnit,
           com.google.api.ads.admanager.axis.v201808.Money valueCostPerUnit,
           com.google.api.ads.admanager.axis.v201808.CostType costType,
           com.google.api.ads.admanager.axis.v201808.LineItemDiscountType discountType,
           java.lang.Double discount,
           java.lang.Long contractedUnitsBought,
           com.google.api.ads.admanager.axis.v201808.CreativePlaceholder[] creativePlaceholders,
           com.google.api.ads.admanager.axis.v201808.LineItemActivityAssociation[] activityAssociations,
           com.google.api.ads.admanager.axis.v201808.EnvironmentType environmentType,
           com.google.api.ads.admanager.axis.v201808.CompanionDeliveryOption companionDeliveryOption,
           java.lang.Boolean allowOverbook,
           java.lang.Boolean skipInventoryCheck,
           java.lang.Boolean skipCrossSellingRuleWarningChecks,
           java.lang.Boolean reserveAtCreation,
           com.google.api.ads.admanager.axis.v201808.Stats stats,
           com.google.api.ads.admanager.axis.v201808.DeliveryIndicator deliveryIndicator,
           com.google.api.ads.admanager.axis.v201808.DeliveryData deliveryData,
           com.google.api.ads.admanager.axis.v201808.Money budget,
           com.google.api.ads.admanager.axis.v201808.ComputedStatus status,
           com.google.api.ads.admanager.axis.v201808.LineItemSummaryReservationStatus reservationStatus,
           java.lang.Boolean isArchived,
           java.lang.String webPropertyCode,
           com.google.api.ads.admanager.axis.v201808.AppliedLabel[] appliedLabels,
           com.google.api.ads.admanager.axis.v201808.AppliedLabel[] effectiveAppliedLabels,
           java.lang.Boolean disableSameAdvertiserCompetitiveExclusion,
           java.lang.String lastModifiedByApp,
           java.lang.String notes,
           com.google.api.ads.admanager.axis.v201808.DateTime lastModifiedDateTime,
           com.google.api.ads.admanager.axis.v201808.DateTime creationDateTime,
           java.lang.Boolean isPrioritizedPreferredDealsEnabled,
           java.lang.Integer adExchangeAuctionOpeningPriority,
           com.google.api.ads.admanager.axis.v201808.BaseCustomFieldValue[] customFieldValues,
           java.lang.Boolean isSetTopBoxEnabled,
           java.lang.Boolean isMissingCreatives,
           com.google.api.ads.admanager.axis.v201808.SetTopBoxInfo setTopBoxDisplayInfo,
           com.google.api.ads.admanager.axis.v201808.ProgrammaticCreativeSource programmaticCreativeSource,
           java.lang.Long videoMaxDuration,
           com.google.api.ads.admanager.axis.v201808.Goal primaryGoal,
           com.google.api.ads.admanager.axis.v201808.Goal[] secondaryGoals,
           com.google.api.ads.admanager.axis.v201808.GrpSettings grpSettings,
           java.lang.Long viewabilityProviderCompanyId,
           com.google.api.ads.admanager.axis.v201808.UserConsentEligibility userConsentEligibility,
           com.google.api.ads.admanager.axis.v201808.Targeting targeting,
           com.google.api.ads.admanager.axis.v201808.CreativeTargeting[] creativeTargetings) {
        super(
            orderId,
            id,
            name,
            externalId,
            orderName,
            startDateTime,
            startDateTimeType,
            endDateTime,
            autoExtensionDays,
            unlimitedEndDateTime,
            creativeRotationType,
            deliveryRateType,
            roadblockingType,
            frequencyCaps,
            lineItemType,
            priority,
            costPerUnit,
            valueCostPerUnit,
            costType,
            discountType,
            discount,
            contractedUnitsBought,
            creativePlaceholders,
            activityAssociations,
            environmentType,
            companionDeliveryOption,
            allowOverbook,
            skipInventoryCheck,
            skipCrossSellingRuleWarningChecks,
            reserveAtCreation,
            stats,
            deliveryIndicator,
            deliveryData,
            budget,
            status,
            reservationStatus,
            isArchived,
            webPropertyCode,
            appliedLabels,
            effectiveAppliedLabels,
            disableSameAdvertiserCompetitiveExclusion,
            lastModifiedByApp,
            notes,
            lastModifiedDateTime,
            creationDateTime,
            isPrioritizedPreferredDealsEnabled,
            adExchangeAuctionOpeningPriority,
            customFieldValues,
            isSetTopBoxEnabled,
            isMissingCreatives,
            setTopBoxDisplayInfo,
            programmaticCreativeSource,
            videoMaxDuration,
            primaryGoal,
            secondaryGoals,
            grpSettings,
            viewabilityProviderCompanyId,
            userConsentEligibility);
        this.targeting = targeting;
        this.creativeTargetings = creativeTargetings;
    }

    @Override
    public String toString() {
        return com.google.common.base.MoreObjects.toStringHelper(this.getClass())
            .omitNullValues()
            .add("activityAssociations", getActivityAssociations())
            .add("adExchangeAuctionOpeningPriority", getAdExchangeAuctionOpeningPriority())
            .add("allowOverbook", getAllowOverbook())
            .add("appliedLabels", getAppliedLabels())
            .add("autoExtensionDays", getAutoExtensionDays())
            .add("budget", getBudget())
            .add("companionDeliveryOption", getCompanionDeliveryOption())
            .add("contractedUnitsBought", getContractedUnitsBought())
            .add("costPerUnit", getCostPerUnit())
            .add("costType", getCostType())
            .add("creationDateTime", getCreationDateTime())
            .add("creativePlaceholders", getCreativePlaceholders())
            .add("creativeRotationType", getCreativeRotationType())
            // Only include length of creativeTargetings to avoid overly verbose output
            .add("creativeTargetings.length", getCreativeTargetings() == null ? 0 : getCreativeTargetings().length)
            .add("customFieldValues", getCustomFieldValues())
            .add("deliveryData", getDeliveryData())
            .add("deliveryIndicator", getDeliveryIndicator())
            .add("deliveryRateType", getDeliveryRateType())
            .add("disableSameAdvertiserCompetitiveExclusion", getDisableSameAdvertiserCompetitiveExclusion())
            .add("discount", getDiscount())
            .add("discountType", getDiscountType())
            .add("effectiveAppliedLabels", getEffectiveAppliedLabels())
            .add("endDateTime", getEndDateTime())
            .add("environmentType", getEnvironmentType())
            .add("externalId", getExternalId())
            .add("frequencyCaps", getFrequencyCaps())
            .add("grpSettings", getGrpSettings())
            .add("id", getId())
            .add("isArchived", getIsArchived())
            .add("isMissingCreatives", getIsMissingCreatives())
            .add("isPrioritizedPreferredDealsEnabled", getIsPrioritizedPreferredDealsEnabled())
            .add("isSetTopBoxEnabled", getIsSetTopBoxEnabled())
            .add("lastModifiedByApp", getLastModifiedByApp())
            .add("lastModifiedDateTime", getLastModifiedDateTime())
            .add("lineItemType", getLineItemType())
            .add("name", getName())
            .add("notes", getNotes())
            .add("orderId", getOrderId())
            .add("orderName", getOrderName())
            .add("primaryGoal", getPrimaryGoal())
            .add("priority", getPriority())
            .add("programmaticCreativeSource", getProgrammaticCreativeSource())
            .add("reservationStatus", getReservationStatus())
            .add("reserveAtCreation", getReserveAtCreation())
            .add("roadblockingType", getRoadblockingType())
            .add("secondaryGoals", getSecondaryGoals())
            .add("setTopBoxDisplayInfo", getSetTopBoxDisplayInfo())
            .add("skipCrossSellingRuleWarningChecks", getSkipCrossSellingRuleWarningChecks())
            .add("skipInventoryCheck", getSkipInventoryCheck())
            .add("startDateTime", getStartDateTime())
            .add("startDateTimeType", getStartDateTimeType())
            .add("stats", getStats())
            .add("status", getStatus())
            // Exclude targeting to avoid overly verbose output
            .add("unlimitedEndDateTime", getUnlimitedEndDateTime())
            .add("userConsentEligibility", getUserConsentEligibility())
            .add("valueCostPerUnit", getValueCostPerUnit())
            .add("videoMaxDuration", getVideoMaxDuration())
            .add("viewabilityProviderCompanyId", getViewabilityProviderCompanyId())
            .add("webPropertyCode", getWebPropertyCode())
            .toString();
    }

    /**
     * Gets the targeting value for this LineItem.
     * 
     * @return targeting   * Contains the targeting criteria for the ad campaign. This attribute
     * is
     *                     required.
     */
    public com.google.api.ads.admanager.axis.v201808.Targeting getTargeting() {
        return targeting;
    }


    /**
     * Sets the targeting value for this LineItem.
     * 
     * @param targeting   * Contains the targeting criteria for the ad campaign. This attribute
     * is
     *                     required.
     */
    public void setTargeting(com.google.api.ads.admanager.axis.v201808.Targeting targeting) {
        this.targeting = targeting;
    }


    /**
     * Gets the creativeTargetings value for this LineItem.
     * 
     * @return creativeTargetings   * A list of {@link CreativeTargeting} objects that can be used
     * to specify creative level
     *                     targeting for this line item. Creative level targeting
     * is specified in a creative placeholder's
     *                     {@link CreativePlaceholder#targetingName} field
     * by referencing the creative targeting's
     *                     {@link CreativeTargeting#name name}. It also needs
     * to be re-specified in the
     *                     {@link LineItemCreativeAssociation#targetingName}
     * field when associating a line item with a
     *                     creative that fits into that placeholder.
     */
    public com.google.api.ads.admanager.axis.v201808.CreativeTargeting[] getCreativeTargetings() {
        return creativeTargetings;
    }


    /**
     * Sets the creativeTargetings value for this LineItem.
     * 
     * @param creativeTargetings   * A list of {@link CreativeTargeting} objects that can be used
     * to specify creative level
     *                     targeting for this line item. Creative level targeting
     * is specified in a creative placeholder's
     *                     {@link CreativePlaceholder#targetingName} field
     * by referencing the creative targeting's
     *                     {@link CreativeTargeting#name name}. It also needs
     * to be re-specified in the
     *                     {@link LineItemCreativeAssociation#targetingName}
     * field when associating a line item with a
     *                     creative that fits into that placeholder.
     */
    public void setCreativeTargetings(com.google.api.ads.admanager.axis.v201808.CreativeTargeting[] creativeTargetings) {
        this.creativeTargetings = creativeTargetings;
    }

    public com.google.api.ads.admanager.axis.v201808.CreativeTargeting getCreativeTargetings(int i) {
        return this.creativeTargetings[i];
    }

    public void setCreativeTargetings(int i, com.google.api.ads.admanager.axis.v201808.CreativeTargeting _value) {
        this.creativeTargetings[i] = _value;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof LineItem)) return false;
        LineItem other = (LineItem) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = super.equals(obj) && 
            ((this.targeting==null && other.getTargeting()==null) || 
             (this.targeting!=null &&
              this.targeting.equals(other.getTargeting()))) &&
            ((this.creativeTargetings==null && other.getCreativeTargetings()==null) || 
             (this.creativeTargetings!=null &&
              java.util.Arrays.equals(this.creativeTargetings, other.getCreativeTargetings())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = super.hashCode();
        if (getTargeting() != null) {
            _hashCode += getTargeting().hashCode();
        }
        if (getCreativeTargetings() != null) {
            for (int i=0;
                 i<java.lang.reflect.Array.getLength(getCreativeTargetings());
                 i++) {
                java.lang.Object obj = java.lang.reflect.Array.get(getCreativeTargetings(), i);
                if (obj != null &&
                    !obj.getClass().isArray()) {
                    _hashCode += obj.hashCode();
                }
            }
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(LineItem.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201808", "LineItem"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("targeting");
        elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201808", "targeting"));
        elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201808", "Targeting"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("creativeTargetings");
        elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201808", "creativeTargetings"));
        elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201808", "CreativeTargeting"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        elemField.setMaxOccursUnbounded(true);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType, 
           java.lang.Class _javaType,  
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType, 
           java.lang.Class _javaType,  
           javax.xml.namespace.QName _xmlType) {
        return 
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}

**LineItemCustom.java**

package net.companyname.task.lineitem.bean;
import java.math.BigDecimal;

import com.google.api.ads.admanager.axis.v201808.LineItem;

public class LineItemCustom extends LineItem
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	Long lineItemCustomId;
	String pacing = "", ctr = "";
	String advertiserName;
	Long advertiserID;
	String lineItemEndDate;
	String bookedImpressions;
	Long viewableImpressions;
	String ctrAndReportCTR;
	BigDecimal viewabilityRate;
	double rate = 0.0;
	BigDecimal revenue;
	public TargetingCustom targeting;

	/**
	 * @return the advertiserID
	 */
	public Long getAdvertiserID() {
		return advertiserID;
	}

	/**
	 * @param advertiserID the advertiserID to set
	 */
	public void setAdvertiserID(Long advertiserID) {
		this.advertiserID = advertiserID;
	}

	/**
	 * @return the lineItemEndDate
	 */
	public String getLineItemEndDate() {
		return lineItemEndDate;
	}

	/**
	 * @param lineItemEndDate the lineItemEndDate to set
	 */
	public void setLineItemEndDate(String lineItemEndDate) {
		this.lineItemEndDate = lineItemEndDate;
	}

	
//	private Targeting targeting;
	
	public LineItemCustom()
	{
		
	}
	
	public String getPacing()
	{
		return pacing;
	}

	public void setPacing(String pacing)
	{
		this.pacing = pacing;
	}

	public TargetingCustom getTargeting()
	{
		return targeting;
	}

	public void setTargeting(TargetingCustom targeting)
	{
		this.targeting = targeting;
	}

	public String getCtr()
	{
		return ctr;
	}

	public void setCtr(String ctr)
	{
		this.ctr = ctr;
	}

	public double getRate()
	{
		return rate;
	}

	public void setRate(double rate)
	{
		this.rate = rate;
	}

	public String getAdvertiserName()
	{
		return advertiserName;
	}

	public void setAdvertiserName(String advertiserName)
	{
		this.advertiserName = advertiserName;
	}

	/**
	 * @return the bookedImpressions
	 */
	public String getBookedImpressions()
	{
		return bookedImpressions;
	}

	/**
	 * @param bookedImpressions the bookedImpressions to set
	 */
	public void setBookedImpressions(String bookedImpressions)
	{
		this.bookedImpressions = bookedImpressions;
	}

	/**
	 * @return the viewableImpressions
	 */
	public Long getViewableImpressions()
	{
		return viewableImpressions;
	}

	/**
	 * @param viewableImpressions the viewableImpressions to set
	 */
	public void setViewableImpressions(Long viewableImpressions)
	{
		this.viewableImpressions = viewableImpressions;
	}

	/**
	 * @return the ctrAndReportCTR
	 */
	public String getCtrAndReportCTR()
	{
		return ctrAndReportCTR;
	}

	/**
	 * @param ctrAndReportCTR the ctrAndReportCTR to set
	 */
	public void setCtrAndReportCTR(String ctrAndReportCTR)
	{
		this.ctrAndReportCTR = ctrAndReportCTR;
	}

	/**
	 * @return the viewabilityRate
	 */
	public BigDecimal getViewabilityRate()
	{
		return viewabilityRate;
	}

	/**
	 * @param viewabilityRate the viewabilityRate to set
	 */
	public void setViewabilityRate(BigDecimal viewabilityRate)
	{
		this.viewabilityRate = viewabilityRate;
	}

	/**
	 * @return the revenue
	 */
	public BigDecimal getRevenue()
	{
		return revenue;
	}

	/**
	 * @param revenue the revenue to set
	 */
	public void setRevenue(BigDecimal revenue)
	{
		this.revenue = revenue;
	}
}

orm.xml

<?xml version="1.0" encoding="UTF-8"?>

<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm 
        http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
	version="2.0">

	<mapped-superclass class="com.google.api.ads.admanager.axis.v201808.LineItem" access="FIELD" >
		<attributes>
			<id name="id">
                <!-- <generated-value strategy="TABLE"/> -->
            </id>
            <basic name="orderId">
            	<column/>
            </basic>
            <basic name="creativeTargetings">
            	<lob/>
            </basic>
            <basic name="targetin">
            	<lob/>
            </basic>
            <many-to-one name="note">
            	<join-column/>
            </many-to-one>
            <transient name="__equalsCalc"/>
            <!-- <transient name="creativeTargetings"/> -->
			<!-- <basic name="hierarchy" /> -->
		</attributes>
	</mapped-superclass>
	
	<!-- <entity class="net.companyname.task.rAndD.bean.Event" access="FIELD" name="Event">
		<attributes>
			<id name="id" />
			<basic name="title" />
			<basic name="date">
				<temporal>DATE</temporal>
			</basic>
		</attributes>
	</entity> -->
	<mapped-superclass class="net.companyname.task.rAndD.bean.Event" access="FIELD" >
		<attributes>
			<id name="id" />
			<!-- <basic name="title" /> -->
			<basic name="date">
				<temporal>DATE</temporal>
			</basic>
		</attributes>
	</mapped-superclass>
	
	<entity class="net.companyname.task.rAndD.bean.ExtendedEvent">
		<attributes>
			<id name="extendedEventId"></id>
		</attributes>
	</entity>
	
	<entity class="net.companyname.task.lineitem.bean.LocationCustom" access="FIELD" name="LocationCustom">
		<attributes>
			<id name="locId">
                <generated-value strategy="TABLE"/>
            </id>
			<basic name="hierarchy" />
		</attributes>
	</entity>
	
	<entity class="net.companyname.task.lineitem.bean.LineItemCustom" access="FIELD" name="LineItemCustom">
		<attributes>
			<id name="lineItemCustomId">
                <generated-value strategy="TABLE"/>
            </id>
            <transient name="__equalsCalc"/>
			<!-- <basic name="hierarchy" /> -->
		</attributes>
	</entity>

</entity-mappings>

Event.java

/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * Copyright (c) 2010, Red Hat Inc. or third-party contributors as
 * indicated by the @author tags or express copyright attribution
 * statements applied by the authors.  All third-party contributions are
 * distributed under license by Red Hat Inc.
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301  USA
 */
package net.companyname.task.rAndD.bean;

import java.util.Calendar;

public class Event {
    private Long id;

    private String title;
    private Calendar date;

	public Event() {
		// this form used by Hibernate
	}

	public Event(Long id, String title, Calendar date) {
		// for application use, to create new events
		this.id = id;
		this.title = title;
		this.date = date;
	}

    public Long getId() {
		return id;
    }

    private void setId(Long id) {
		this.id = id;
    }

    public Calendar getDate() {
		return date;
    }

    public void setDate(Calendar date) {
		this.date = date;
    }

    public String getTitle() {
		return title;
    }

    public void setTitle(String title) {
		this.title = title;
    }
}

**ExtendedEvent.java**

package net.companyname.task.rAndD.bean;

public class ExtendedEvent extends Event{
	int extendedEventId;
	String uniqueProperty;
	int sampleInt;
	/**
	 * @return the extendedEventId
	 */
	public int getExtendedEventId() {
		return extendedEventId;
	}
	/**
	 * @param extendedEventId the extendedEventId to set
	 */
	public void setExtendedEventId(int extendedEventId) {
		this.extendedEventId = extendedEventId;
	}
	/**
	 * @return the uniqueProperty
	 */
	public String getUniqueProperty() {
		return uniqueProperty;
	}
	/**
	 * @param uniqueProperty the uniqueProperty to set
	 */
	public void setUniqueProperty(String uniqueProperty) {
		this.uniqueProperty = uniqueProperty;
	}
	/**
	 * @return the sampleInt
	 */
	public int getSampleInt() {
		return sampleInt;
	}
	/**
	 * @param sampleInt the sampleInt to set
	 */
	public void setSampleInt(int sampleInt) {
		this.sampleInt = sampleInt;
	}
}

Thank you.


#2

You need to add all classes to the post and remove the link to Google Drive. Afterward, I’ll investigate it and help you with your mapping.


#3

Hello vlad,

I’ve updated by question with classes.

Thank you.


#4

You need to add mapped-superclass for LineItemSummary if you want to persist properties from that base class.

Now, the best way to see how that can be done is to provide a replicating test case using this template. Once you have the test case running, give e the URL to your GitHub repository so I can investigate it.

And, use a simpler class hierarchy because the one you provided has too many properties that are not relevant to this problem.