I want to use a composite key with the response coming in from Named query 
directly into a C# class say Marks,  consider the example of Marks table 
which has composite key (SubjectID, StudentID, ExamID).

*I cannot* *use* the row_number as it messes up the cache mechanism if the 
named query is called multiple times in same session.

Right now I am using a padding mechanism to generate a unique id, but would 
like to change this solution to use directly use the columns for composite 
key 

CAST( RIGHT('0000000' + CAST(SubjectID AS VARCHAR(6)), 6) + RIGHT('0000000' 
+ CAST(StudentId AS VARCHAR(6)), 6) + RIGHT('0000000' + CAST(ExamID AS 
VARCHAR(6)), 6) AS BIGINT) as Id

let me know if you have solution. 
 

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to