3 using System.Collections.Generic;
4 using System.Linq.Expressions;
12 namespace Deveel.Data.Linq {
20 public override string GetColumnName(MappingEntity entity, MemberInfo member) {
22 var memberMapping = dbMapping.TypeMapping.GetMember(member.Name);
23 if (memberMapping == null)
26 return memberMapping.ColumnName;
29 public override MappingEntity
GetEntity(Type elementType,
string tableId) {
30 var typeMapping = Model.GetMapping(elementType);
31 if (typeMapping == null)
32 throw new QueryException(String.Format(
"The type '{0}' is not mapped by the model", elementType));
37 public override bool IsPrimaryKey(MappingEntity entity, MemberInfo member) {
39 return dbMapping.TypeMapping.IsPrimaryKey(member.Name) ||
40 dbMapping.TypeMapping.IsUniqueKey(member.Name);
45 return dbMapping.TypeMapping.TableName;
52 public override bool IsGenerated(MappingEntity entity, MemberInfo member) {
54 return dbMapping.TypeMapping.IsUniqueKey(member.Name);
57 public override bool IsColumn(MappingEntity entity, MemberInfo member) {
59 return dbMapping.TypeMapping.IsMemberMapped(member.Name) &&
60 dbMapping.TypeMapping.IsColumn(member.Name);
64 return base.IsAssociationRelationship(entity, member);
68 return base.GetAssociationKeyMembers(entity, member);
72 return base.GetAssociationRelatedKeyMembers(entity, member);
87 var mapppedMember = dbMapping.TypeMapping.GetMember(member.Name);
88 if (mapppedMember == null)
92 return mapppedMember.ColumnType.TypeCode.ToString();
95 #region DbMappingEntity
99 this.tableId = tableId;
107 public override string TableId {
108 get {
return tableId; }
111 public override Type ElementType {
115 public override Type EntityType {
DbMappingEntity(string tableId, TypeMapping typeMapping)
override string GetColumnName(MappingEntity entity, MemberInfo member)
override string GetTableName(MappingEntity entity)
override bool IsRelationshipTarget(MappingEntity entity, MemberInfo member)
DeveelDbMapping(MappingModel model)
override bool IsColumn(MappingEntity entity, MemberInfo member)
override bool IsGenerated(MappingEntity entity, MemberInfo member)
override bool IsPrimaryKey(MappingEntity entity, MemberInfo member)
override MappingEntity GetEntity(Type elementType, string tableId)
override IEnumerable< MemberInfo > GetAssociationRelatedKeyMembers(MappingEntity entity, MemberInfo member)
override bool IsRelationshipSource(MappingEntity entity, MemberInfo member)
override string GetColumnDbType(MappingEntity entity, MemberInfo member)
override string GetTableId(Type type)
override bool IsAssociationRelationship(MappingEntity entity, MemberInfo member)
override IEnumerable< MemberInfo > GetAssociationKeyMembers(MappingEntity entity, MemberInfo member)