Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impex] &ref not working when updated in between #35

Open
bnussbau opened this issue Dec 1, 2018 · 1 comment
Open

[Impex] &ref not working when updated in between #35

bnussbau opened this issue Dec 1, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@bnussbau
Copy link
Collaborator

bnussbau commented Dec 1, 2018

 <type name="Product" package="at.benjaminnussbaum.spotbudget.types.itemtypes.product">
        <properties>
            <property name="brand" type="String">
                <description></description>
            </property>
            <property name="name" type="String">
                <description></description>
            </property>
            <property name="fullName" type="String">
                <description></description>
            </property>
            <property name="productDescription" type="String">
                <description></description>
            </property>
            <property name="receiptText" type="String">
                <description></description>
            </property>
            <property name="category" type="String">
                <description></description>
            </property>
            <property name="pictureUrl" type="String">
                <description></description>
            </property>
            <property name="sparProductCode" type="String">
                <description></description>
            </property>
        </properties>
    </type>
<type name="Ean13Product" package="at.benjaminnussbaum.spotbudget.types.itemtypes.product" extends="EanProduct">
        <properties>
            <property name="ean13code" type="String" unique="true">
                <description>EAN / EAN-13 barcode</description>
            </property>
            <property name="variableEan" type="Boolean" default="false">
                <description></description>
            </property>
            <property name="variableEanDigits" type="Integer">
                <description></description>
            </property>
        </properties>
    </type>
<type name="PriceRow" package="at.benjaminnussbaum.spotbudget.types.itemtypes.product.price">
        <properties>
            <property name="amount" type="Double">
                <description></description>
            </property>
            <property name="date" type="LocalDateTime">
                <description>Tansaction date</description>
            </property>
            <property name="currency" type="Currency">
                <description>Transaction amount</description>
            </property>
            <property name="provider" type="PriceProviderType">
                <description></description>
            </property>
        </properties>
    </type>

    <relation name="Product2PriceRow">
        <source itemType="Product" mappedBy="product" cardinality="one">
            <description></description>
        </source>
        <target itemType="PriceRow" mappedBy="priceRows" cardinality="many">
            <description></description>
        </target>
    </relation>
INSERT_UPDATE Ean13Product; ean13code[unique = true]; receiptText                ; &ref
                          ; 9100000709444           ; SBUDGET KUECHENROLLE       ; 9100000709444

UPDATE Ean13Product; ean13code[unique = true]; receiptText           ; sparProductCode;
                   ; 9100000709444           ; SBUDGET KUECHENROLLE  ; 2020000926726

INSERT_UPDATE PriceRow; product(&ref)        ; amount;
                      ; 9100000709444       ; 2.19  ;
Caused by: org.springframework.transaction.TransactionUsageException: Error during transactional execution.; nested exception is io.spotnext.core.infrastructure.exception.ImpexImportException: Could not import item of type at.benjaminnussbaum.spotbudget.types.itemtypes.product.price.PriceRow (Found more than 1 result for the given search parameters). Line that caused this error: , 9100000709444, 2.19, 
	at io.spotnext.core.persistence.service.impl.DefaultTransactionService.execute(DefaultTransactionService.java:94)
	at io.spotnext.core.persistence.service.impl.DefaultTransactionService.executeWithoutResult(DefaultTransactionService.java:110)
	at io.spotnext.core.infrastructure.strategy.impl.DefaultImpexImportStrategy.importImpex(DefaultImpexImportStrategy.java:129)
	at io.spotnext.core.infrastructure.service.impl.DefaultImportService.importItems(DefaultImportService.java:39)
	at io.spotnext.core.infrastructure.support.init.ModuleInit.importScript(ModuleInit.java:177)
	at at.benjaminnussbaum.spotbudget.Init.importSampleData(Init.java:29)

Without the UPDATE line, it works.
Is that something that should be considered?

@bnussbau bnussbau added the bug label Dec 1, 2018
@mojo2012 mojo2012 self-assigned this Dec 10, 2018
@mojo2012 mojo2012 added this to the 1.0 milestone Dec 10, 2018
@mojo2012
Copy link
Member

Fixed. todo for me: add an integrationtest

@mojo2012 mojo2012 added todo and removed bug labels Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants