CREATE FOREIGN TABLE A (
	a_id integer NOT NULL OPTIONS (NATIVE_TYPE 'Edm.Int32'),
	a_value string(4000),
	PRIMARY KEY(a_id)
) OPTIONS (UPDATABLE TRUE, "teiid_odata:NameInSchema" 'data.A', "teiid_odata:Type" 'ENTITY_COLLECTION', "teiid_rel:fqn" 'entity+container=data/entity+set=A');

CREATE FOREIGN TABLE A_C_FK0 (
	c_id integer NOT NULL OPTIONS (NATIVE_TYPE 'Edm.Int32'),
	a_id integer OPTIONS (NATIVE_TYPE 'Edm.Int32'),
	A_a_id integer OPTIONS (UPDATABLE FALSE, "teiid_odata:PSEUDO" 'true'),
	PRIMARY KEY(c_id),
	FOREIGN KEY(A_a_id) REFERENCES teiid.A (a_id)
) OPTIONS (NAMEINSOURCE 'C_FK0', UPDATABLE TRUE, "teiid_odata:NameInSchema" 'data.C', "teiid_odata:Type" 'NAVIGATION_COLLECTION', "teiid_rel:fqn" 'entity+container=data/entity+set=A/expand%3D=C_FK0');

CREATE FOREIGN TABLE C (
	c_id integer NOT NULL OPTIONS (NATIVE_TYPE 'Edm.Int32'),
	a_id integer OPTIONS (NATIVE_TYPE 'Edm.Int32'),
	PRIMARY KEY(c_id),
	CONSTRAINT A_FK0 FOREIGN KEY(a_id) REFERENCES teiid.A (a_id)
) OPTIONS (UPDATABLE TRUE, "teiid_odata:NameInSchema" 'data.C', "teiid_odata:Type" 'ENTITY_COLLECTION', "teiid_rel:fqn" 'entity+container=data/entity+set=C');

CREATE FOREIGN TABLE C_FK0 (
	a_id integer NOT NULL OPTIONS (NATIVE_TYPE 'Edm.Int32'),
	a_value string(4000),
	C_c_id integer OPTIONS (UPDATABLE FALSE, "teiid_odata:PSEUDO" 'true'),
	PRIMARY KEY(a_id),
	FOREIGN KEY(C_c_id) REFERENCES teiid.C (c_id)
) OPTIONS (NAMEINSOURCE 'FK0', UPDATABLE TRUE, "teiid_odata:NameInSchema" 'data.A', "teiid_odata:Type" 'NAVIGATION', "teiid_rel:fqn" 'entity+container=data/entity+set=C/expand%3D=FK0');