- changed status to resolved
FindOne<T> where id as TGuid
Methods like FindOne, for example, expect parameters of type TValue and when trying to use im TGuid, the error occurs: incompatible types: TValue and TGUID.
Comments (6)
-
repo owner -
reporter after doing that i have this message in select or inserts/updates. My database is oracle and the models are mapped as TGuid, but with other data types like TArray<System.byte>, the same thing happens.
-
repo owner You need to consult the FireDAC help about that exception and possibly add some data type mapping options.
-
reporter I believe that I have no problems with Firedac, since using the FDQuery component insertions of GUID types occur normally, only via Marshmallow do I observe problems with this data type, any parameterization in Firedac would break the use of native FDQuery.
-
repo owner Then you need to step through the code and check what data type it is complaining about and why it cannot properly insert a TGuid - possibly it does not set the required datatype for the parameter.
This should happen in TDBParam.TypeInfoToFieldType in Spring.Persistence.SQL.Params.pasWith the limited information you provide, I cannot give you any solution.
-
repo owner I just tested using the TFireDACConnectionAdapter with a TFDConnection fetching some entity with a primary key property that is TGUID on SQL Server and it works - so it looks to be an oracle specific issue. Is the database column RAW(16)? Then it looks to be a mapping/conversion issue between ftGuid and that field. If it works with a TFDQuery please check what fieldType is created for that column.
- Log in to comment
Because TValue does not have an implicit operator for TGUID. You need to explicitly wrap the TGuid into a TValue with TValue.From(aId)