sorry but something is missing do you mean: ... var fEntity: TEntity; Id: Integer; begin fEntity := Manager.find<TEntity>(1); Id := fEntity.JobId.Key; end;
if so: [dcc32 Error] DB.Entity.pas(838): E2003 Undeclared identifier: 'key'
Well, I didn't see your full class, but I guess fEntity.JobId is of type TJob, not Proxy<TJob>, isn't it? If yes, then of course Key property will not be available.
It's the Proxy<TJob> that has a Key property, not your entity. You can simply create a property JobIdKey and implement the getter returning the Key value from the proxy type.
Hi, "...but I guess fEntity.JobId is of type TJob...", no, has you can see in TEntity, [Association([TAssociationProp.Lazy], CascadeTypeAll - [TCascadeType.Remove])] [JoinColumn('JobId', [], 'Id')] FJobId: Proxy<TJob>;
Hi, sorry Wagner but i just can't understand. FJobId is Private, and should access Public properties ... public property JobId: TJob read GetJobId write SetJobId; ...
One more thing, Schema is generate with DataModeler