Require Subquer
I have a table evaluation which has fields like text, create_user,create_time and update_user, My current requirement is that I need to get the first name and last name of create_user from the person table and create_user is not a primary key in person table. Person table field are id (pk), login, password, firstname and last name. Create_user should be mapped with login and fetch the first name and last name. I am looking for a code snippet to write the query to fetch the firstname and last name.
Support Staff 2 Posted by James Gregory on 17 Mar, 2010 11:36 AM
I'm going to need you to explain your problem a little clearer if you want me to help. Please show me your schema, any mappings you have, and what you've tried so far.
3 Posted by Thiyagarajan on 17 Mar, 2010 01:21 PM
I have pasted the code snippet below
WithTable("elevevaluering");
Id(x => x.Id, "elevevaluering_id")
.GeneratedBy .Native();
Map(x => x.Text).ColumnName("evaluering");
Map(x => x.InternNote).CustomTypeIs().ColumnNames.Add("intern_note");
Map(x => x.CreateTime).ColumnName("create_time");
Map(x => x.CreateUser).ColumnName("create_user");
Map(x => x.UpdateTime).ColumnName("update_time");
Map(x => x.UpdateUser).ColumnName("update_user");
References(x => x.Skole).ColumnName("skole_fk");
References(x => x.UdbudtLæringsaktivitet).ColumnName("udbudt_lakt_fk");
References(x => x.UdbudtLæringselement).ColumnName("udbudt_lelem_fk");
References(x => x.Person).ColumnName("person_fk");
References(x => x.UvmFag).ColumnName("uvmfag_fk");
As I explained in my earlier post, I need to get the firstname and last name of create_user from person table.
Support Staff 4 Posted by James Gregory on 17 Mar, 2010 01:24 PM
What's create_user? A string? How is it associate with the Person table?
If you show me your entities, I'll be able to understand better.
5 Posted by Thiyagarajan on 18 Mar, 2010 05:06 AM
create_user (string type) in elevevaluering table relates with the brugerlogin( not a primary key, string type) in person table and find the attachment for E/R diagram that will give you information about the entities.