Esempio n. 1
0
        private static void ForcePropertyInsertable(ClassAuditingData classAuditingData, string propertyName,
											 string entityName, string referencedEntityName)
        {
            if (propertyName != null)
            {
                if (classAuditingData.GetPropertyAuditingData(propertyName) == null)
                {
                    throw new MappingException("@AuditMappedBy points to a property that doesn't exist: " +
                        referencedEntityName + "." + propertyName);
                }
                log.DebugFormat("Non-insertable property {0}, {1} will be made insertable because a matching @AuditMappedBy was found in the {2} entity.",
                    referencedEntityName, propertyName, entityName);

                classAuditingData
                        .GetPropertyAuditingData(propertyName)
                        .ForceInsertable = true;
            }
        }
Esempio n. 2
0
        private void AddProperties(XmlElement parent, IEnumerable<Property> properties, ICompositeMapperBuilder currentMapper,
									ClassAuditingData auditingData, string entityName, EntityXmlMappingData xmlMappingData,
									bool firstPass)
        {
            foreach (var property in properties)
            {
                var propertyName = property.Name;
                var propertyAuditingData = auditingData.GetPropertyAuditingData(propertyName);
                if (propertyAuditingData != null)
                {
                    AddValue(parent, property.Value, currentMapper, entityName, xmlMappingData, propertyAuditingData,
                            property.IsInsertable, firstPass);
                }
            }
        }
Esempio n. 3
0
        private static bool CheckPropertiesAudited(IEnumerable<Property> properties, ClassAuditingData auditingData)
        {
            foreach (var property in properties)
            {
                var propertyName = property.Name;
                var propertyAuditingData = auditingData.GetPropertyAuditingData(propertyName);
                if (propertyAuditingData == null)
                {
                    return false;
                }
            }

            return true;
        }