]
Steven Hawkins updated TEIID-4517:
----------------------------------
Fix Version/s: 9.2
Add support for deleting child objects
--------------------------------------
Key: TEIID-4517
URL:
https://issues.jboss.org/browse/TEIID-4517
Project: Teiid
Issue Type: Feature Request
Components: Misc. Connectors
Affects Versions: 9.2, 8.12.7.6_3
Reporter: Jan Stastny
Assignee: Van Halbert
Priority: Critical
Fix For: 9.2
Infinispan cache dsl translator currently doesn't support deleting child objects when
using complex POJO classes.
Example of complex POJO:
{code:plain}
package org.jboss.qe.jdg.remote.protobuf.complex;
/* @Indexed */
message Person {
/* @IndexedField(index=true, store=false) */
required int32 id = 1;
/* @IndexedField */
required string name = 2;
/* @IndexedField */
optional string email = 3;
/* @IndexedField(index=true, store=false) */
repeated PhoneNumber phones = 4;
/* @Indexed */
message Address {
/* @IndexedField */
required string Address = 1;
/* @IndexedField(index=true, store=false) */
required string City = 2;
/* @IndexedField(index=true, store=false) */
required string State = 3;
}
/* @IndexedField(index=true, store=false) */
optional Address address = 5;
}
/* @Indexed */
message PhoneNumber {
/* @IndexedField */
required string number = 1;
}
{code}
Mapped metadata:
{code:sql}
CREATE FOREIGN TABLE Address (
Address string NOT NULL PRIMARY KEY OPTIONS (NAMEINSOURCE 'address.Address',
SEARCHABLE 'Searchable', NATIVE_TYPE 'java.lang.String'),
City string NOT NULL OPTIONS (NAMEINSOURCE 'address.City', SEARCHABLE
'Searchable', NATIVE_TYPE 'java.lang.String'),
State string NOT NULL OPTIONS (NAMEINSOURCE 'address.State', SEARCHABLE
'Searchable', NATIVE_TYPE 'java.lang.String'),
id integer NOT NULL OPTIONS (NAMEINSOURCE 'id', SELECTABLE FALSE, SEARCHABLE
'Searchable', NATIVE_TYPE 'int'),
CONSTRAINT FK_PERSON FOREIGN KEY(id) REFERENCES Person (id) OPTIONS (NAMEINSOURCE
'address')
) OPTIONS (UPDATABLE TRUE);
CREATE FOREIGN TABLE Person (
id integer NOT NULL OPTIONS (NAMEINSOURCE 'id', SEARCHABLE
'Searchable', NATIVE_TYPE 'int'),
name string NOT NULL OPTIONS (NAMEINSOURCE 'name', SEARCHABLE
'Searchable', NATIVE_TYPE 'java.lang.String'),
email string OPTIONS (NAMEINSOURCE 'email', SEARCHABLE 'Searchable',
NATIVE_TYPE 'java.lang.String'),
CONSTRAINT PK_ID PRIMARY KEY(id)
) OPTIONS (UPDATABLE TRUE);
CREATE FOREIGN TABLE PhoneNumber (
number string NOT NULL PRIMARY KEY OPTIONS (NAMEINSOURCE 'phones.number',
SEARCHABLE 'Searchable', NATIVE_TYPE 'java.lang.String'),
id integer NOT NULL OPTIONS (NAMEINSOURCE 'id', SELECTABLE FALSE, SEARCHABLE
'Searchable', NATIVE_TYPE 'int'),
CONSTRAINT FK_PERSON FOREIGN KEY(id) REFERENCES Person (id) OPTIONS (NAMEINSOURCE
'phones')
) OPTIONS (UPDATABLE TRUE);
{code}
Expected usage:
{code:sql}
DELETE FROM PhoneNumber WHERE id=3
{code}