Автоматически сгенерированный объект POKey в ошибках компиляции Intershop 7 - PullRequest
0 голосов
/ 13 июня 2018

Мы переносим сайт с Intershop 6.4 на Intershop 7.9.Как подсказывает поддержка Intershop, мы пытаемся воссоздать все автоматически сгенерированные классы из модели EDL.

Вот код интерфейса EDL:

import "enfinity:/core/edl/com/intershop/beehive/core/types.edl";
import "enfinity:/core/edl/com/intershop/beehive/core/capi/domain/PersistentObject.edl";
import "enfinity:/core/edl/com/intershop/beehive/core/capi/domain/PersistentObjectPO.edl";

external PromotionCollection type "java.util.Collection<A1Promotion>";

namespace hr.a1.core.capi.promotion
{
    cartridge interface A1Promotion extends PersistentObject
    {
        /**
         * Promotion TMCode.
         */
        attribute tmCode: string required;

        /**
         * Siebel promotion id.
         */
        attribute siebelID: string required;

        /**
         * Promotion name.
         */
        attribute name: string required;

        /**
         * Promotion description / currently URL to CW.
         */
        attribute description: string;

        /**
         * Defines promotion priority / lower values first.
         */
        attribute priority: int;

        /**
         * Holds link to tariff.
         */
        attribute tariffID: uuid;

        /**
         * Contract type (A, M, R).
         */
        attribute contractType: string required;

        /**
         * Contract binding (0, 12, 24).
         */
        attribute contractBinding: string required;

        /**
         * Discount type / MF - monthly fee, HW - hardware, FU - free unit (not used at the moment)
         */
        attribute discountType: string required;

        /**
         * Discount mode / P - percentage or F - fixed amount
         */
        attribute discountMode: string;

        /**
         * Discount amount / either money value or percentage value / stored internally as Money
         */
        attribute discountAmount: Money;

        /*
         * Flag which if it set disables checkbox of current promotion so user can't deselect it.
         */
        attribute preselected: boolean;

        /**
         * Promotion validity / from date.
         */
        attribute activeFrom: datetime;

        /**
         * Promotion validity / to date.
         */
        attribute activeTo: datetime;

        /**
         * Promotion group / D - default, N - personalized, S% - Special
         */
        attribute promotionGroup: string required;

         /**
         * Promotion type / S - single, G - group
         */
        attribute promotionType: string required;

        /**
         * Free units amount type (MB, GB, SMS..)
         */
        attribute units: string;

        /**
         * Group rule defined for promotion if promotion is group promotion
         */
        attribute groupRule: string;

        /**
         * Name of the coupon list for the coupon promotions
         */
        attribute couponListName: string;

        /**
         * HW promotion discount id
         */
        attribute discountId: int; 
    }

}

и это PO EDLcode:

import "enfinity:/app_core_a1/edl/app_core_a1/capi/A1Promotion.edl";
import "enfinity:/xcs/edl/com/intershop/beehive/xcs/internal/product/ProductPO.edl";
import "enfinity:/core/edl/com/intershop/beehive/core/types.edl";
import "enfinity:/core/edl/com/intershop/beehive/core/capi/domain/PersistentObjectPO.edl";

namespace hr.a1.core.internal.promotion
{
    /*
     * @author dragisic
     */
    orm class A1PromotionPO extends PersistentObjectPO implements A1Promotion table "A1Promotion"
    {
        /**
         * Promotion id.
         */
        attribute tmCode : string<25> required column "tm_code";

        /**
         * Siebel promotion id.
         */
        attribute siebelID : string<25> required column "siebel_id";

        /**
         * Promotion name.
         */
        attribute name : string<100> required column "name";

        /**
         * Promotion description / currently URL to CW.
         */
        attribute description : string<255> column "description";

        /**
         * Defines promotion priority / lower values first.
         */
        attribute priority : int column "priority";

        /**
         * Holds link to tariff.
         */
        attribute tariffID : uuid;

        /**
         * Contract type (A, M, R).
         */
        attribute contractType : string<1> required column "contract_type";

        /**
         * Contract binding (0, 12, 24).
         */
        attribute contractBinding : string<4> required column "contract_binding";

        /**
         * Discount type / MF - monthly fee, HW - hardware, FU - free unit (not used at the moment)
         */
        attribute discountType : string<2> required column "discount_type";

        /**
         * Discount mode / P - percentage or F - fixed amount
         */
        attribute discountMode : string<1> column "discount_mode";

        /**
         * Discount amount / either money value or percentage value / stored internally as Money
         */
        attribute discountAmount : Money column "discount_amount";

        /**
         * Flag which if it set disables checkbox of current promotion so user can't deselect it.
         */
        attribute preselected : boolean column "is_preselected";

        /**
         * Promotion validity / from date.
         */
        attribute activeFrom : datetime column "active_from";

        /**
         * Promotion validity / to date.
         */
        attribute activeTo : datetime column "active_to";

        /**
         * Promotion group / D - default, N - personalized, S% - Special
         */
        attribute promotionGroup : string<3> required column "promo_group";

         /**
         * Promotion type / S - single, G - group
         */
         attribute promotionType : string<1> required column "promo_type";

        /**
         * Free units amount type (MB, SMS..)
         */
        attribute units : string<4> column "units";

        /**
         * Group rule defined for promotion if promotion is group promotion
         */
        attribute groupRule : string<10> column "group_rule";

        /**
         * Name of the coupon list for the coupon promotions
         */
         attribute couponListName: string<100> column "coupon_list_name";

         /**
         * Defines HW promotion discount id.
         */
        attribute discountId : int column "discount_id";

        /**
         * Declare index in search items.
         */
        index (contractType, contractBinding);
    }
}

Однако, когда мы генерируем код с помощью «Генератора кода для Intershop версии 7.2 и выше», мы получаем следующие ошибки компиляции в автоматически сгенерированном классе A1PromotionPOKey.java:

"Конструктор Object (String) не определен" "Иерархия типа A1PromotionPOKey противоречива"

Автоматически сгенерированный класс выглядит следующим образом:

// =============================================================================
// File: A1PromotionPOKey.java
// Generated by JGen Code Generator from INTERSHOP Communications AG.
// Generator template: ORMKey.xpt(checksum: b5b09bf4e9329db7d7dafe870b159b0d)
// =============================================================================
// The JGen Code Generator software is the property of INTERSHOP Communications AG.
// Any rights to use are granted under the license agreement.
// =============================================================================
package hr.a1.core.internal.promotion;

import com.intershop.beehive.core.capi.domain.PersistentObjectPOKey;

/**
 * This class represents the primary key for objects of type A1PromotionPO.
 * The key objects can be used for lookup operations in the database.
 * 
 * @author dragisic
 * @generated
 */
public class A1PromotionPOKey extends PersistentObjectPOKey {
    /**
     * Useless constant to make compiler happy.
     *
     * @generated
     */
    private static final long serialVersionUID = 1L;

    /**
     * Creates an empty primary key. After creation of a new key object
     * you must call the corresponding set<i>Attribute</i> method(s) to 
     * set the value(s) of the primary key.
     *
     * @generated
     */
    public A1PromotionPOKey() {
    }

    /**
     * Creates a primary key with the specified value(s).
     *
     * @generated
     */
    public A1PromotionPOKey(
        String UUID) {
        super(UUID);
    }

}

Мы проверилиЗависимости gradle и импорт PersistentObjectPOKey выглядят хорошо, а содержащийся контейнер добавляется в картридж.Мы также попытались перезапустить Studio и обновить проект, но это не помогает.Та же модель EDL работает нормально и создает скомпилированный автоматически сгенерированный код в Enfinity Suite 6.4.

РЕДАКТИРОВАТЬ:

Кроме того, я присоединяю ошибки из журнала консоли во время сборки проекта gradle.

:app_core_a1:compileJavaC:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOKey.java:20: error: cannot access CacheClearKey
public class A1PromotionPOKey extends
       ^
  class file for com.intershop.beehive.cache.capi.common.CacheClearKey not found
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\capi\promotion\A1PromotionMgr.java:11: warning: [deprecation] Manager in com.intershop.beehive.core.capi.common has been deprecated
import com.intershop.beehive.core.capi.common.Manager;
                                             ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOFactory.java:14: warning: [deprecation] UUIDMgr in com.intershop.beehive.core.capi.util has been deprecated
import com.intershop.beehive.core.capi.util.UUIDMgr;
                                           ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\capi\promotion\A1PromotionMgr.java:11: warning: [deprecation] Manager in com.intershop.beehive.core.capi.common has been deprecated
import com.intershop.beehive.core.capi.common.Manager;
                                             ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOFactory.java:14: warning: [deprecation] UUIDMgr in com.intershop.beehive.core.capi.util has been deprecated
import com.intershop.beehive.core.capi.util.UUIDMgr;
                                           ^
warning: The following options were not recognized by any processor: '[componentName]'
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\capi\promotion\A1PromotionMgr.java:11: warning: [deprecation] Manager in com.intershop.beehive.core.capi.common has been deprecated
import com.intershop.beehive.core.capi.common.Manager;
                                             ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOFactory.java:14: warning: [deprecation] UUIDMgr in com.intershop.beehive.core.capi.util has been deprecated
import com.intershop.beehive.core.capi.util.UUIDMgr;
                                           ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\capi\promotion\A1PromotionMgr.java:24: warning: [deprecation] Manager in com.intershop.beehive.core.capi.common has been deprecated
    Manager {
    ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPO.java:120: error: incompatible types: A1PromotionPOKey cannot be converted to PersistentObjectPOKey
        super(factory, key);
                       ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOFactory.java:82: error: incompatible types: A1PromotionPOKey cannot be converted to ORMObjectKey
        A1PromotionPO instance = (A1PromotionPO) getEngine().getPersistenceManager().createObject(key, getClassDescription());
                                                                                                  ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOFactory.java:110: warning: [deprecation] UUIDMgr in com.intershop.beehive.core.capi.util has been deprecated
            UUIDMgr.getInstance().createUUIDString(), domain.getUUID(), tmCode, siebelID, name, contractType, contractBinding, discountType, promotionGroup, promotionType);
            ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOFactory.java:110: warning: [deprecation] getInstance() in UUIDMgr has been deprecated
            UUIDMgr.getInstance().createUUIDString(), domain.getUUID(), tmCode, siebelID, name, contractType, contractBinding, discountType, promotionGroup, promotionType);
                   ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOFactory.java:110: warning: [deprecation] createUUIDString() in UUIDMgr has been deprecated
            UUIDMgr.getInstance().createUUIDString(), domain.getUUID(), tmCode, siebelID, name, contractType, contractBinding, discountType, promotionGroup, promotionType);
                                 ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOFactory.java:149: error: incompatible types: A1PromotionPOKey cannot be converted to ORMObjectKey
        return (A1PromotionPO) super.getObjectByPrimaryKeyObject(key);
                                                                 ^
C:\Work\VIPnet\a1webshop\app_core_a1\src\main\java\hr\a1\core\internal\promotion\A1PromotionPOFactory.java:178: error: incompatible types: A1PromotionPOKey cannot be converted to ORMObjectKey
        return (A1PromotionPO) super.getObjectByPrimaryKeyObject(key, mode);
...