SQL Schema:
CREATE TABLE `object` (
`id` INT NOT NULL,
PRIMARY KEY (`id`));
CREATE TABLE `media` (
`id` INT NOT NULL,
`object_id` INT NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY fk_object(object_id)
REFERENCES object(id));
TDBM generate a getter on the Object
Entity named getMediasByObjectId(): AlterableResultIterator
.
Here, because of the unique index on object_id, the relation is a OneToOne and not a OneToMany, so the generated method should have been getMediaByObjectId(): ?Media
(notice the return type is nullable as TDBM can't ensure the existence)