public static Call ( Arebis _host, IZetboxContext ctx, string prefix, CompoundObjectProperty prop, string propName, string columnName, bool forceDefinition, string implementationSuffix ) : void | ||
_host | Arebis | |
ctx | IZetboxContext | |
prefix | string | |
prop | CompoundObjectProperty | |
propName | string | |
columnName | string | |
forceDefinition | bool | |
implementationSuffix | string | |
리턴 | void |
protected virtual void ApplyCompoundObjectProperty(string prefix, CompoundObjectProperty prop) { CompoundObjectPropertyHbm.Call(Host, ctx, prefix, prop, null, null, false, ImplementationSuffix); }
public override void Generate() { #line 31 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects("<?xml version=\"1.0\"?>\r\n"); this.WriteObjects("<hibernate-mapping xmlns=\"urn:nhibernate-mapping-2.2\" \r\n"); this.WriteObjects(" default-cascade=\"save-update\"\r\n"); this.WriteObjects(" assembly=\"Zetbox.Objects.NHibernateImpl\">\r\n"); this.WriteObjects("\r\n"); this.WriteObjects(" <!-- RelationCollectionEntries -->\r\n"); #line 38 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" foreach (var rel in ctx.GetQuery <Relation>() .Where(r => r.Storage == StorageType.Separate) .ToList() .OrderBy(r => r.GetRelationClassName())) { var collectionEntryNamespace = rel.Module.Namespace; var collectionEntryClassName = rel.GetRelationClassName() + ImplementationSuffix; var proxyClassName = rel.GetRelationClassName() + "Proxy"; var schemaName = rel.Module.SchemaName; var tableName = rel.GetRelationTableName(); #line 49 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <class name=\"", collectionEntryNamespace, ".", collectionEntryClassName, "+", proxyClassName, "\"\r\n"); this.WriteObjects(" proxy=\"", collectionEntryNamespace, ".", collectionEntryClassName, "+", proxyClassName, "\"\r\n"); this.WriteObjects(" table=\"`", tableName, "`\"\r\n"); this.WriteObjects(" schema=\"`", schemaName, "`\" >\r\n"); this.WriteObjects("\r\n"); #line 54 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" IdGeneratorHbm.Call(Host, "id", schemaName, tableName); #line 55 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects("\r\n"); this.WriteObjects(" <many-to-one name=\"A\"\r\n"); this.WriteObjects(" column=\"`", rel.GetRelationFkColumnName(RelationEndRole.A), "`\" />\r\n"); this.WriteObjects(" <many-to-one name=\"B\"\r\n"); this.WriteObjects(" column=\"`", rel.GetRelationFkColumnName(RelationEndRole.B), "`\" />\r\n"); #line 60 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" if (rel.NeedsPositionStorage(RelationEndRole.A)) { #line 61 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <property name=\"A", Zetbox.API.Helper.PositionSuffix, "\"\r\n"); this.WriteObjects(" column=\"`", Construct.ListPositionColumnName(rel.B), "`\" />\r\n"); #line 63 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 64 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" if (rel.NeedsPositionStorage(RelationEndRole.B)) { #line 65 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <property name=\"B", Zetbox.API.Helper.PositionSuffix, "\"\r\n"); this.WriteObjects(" column=\"`", Construct.ListPositionColumnName(rel.A), "`\" />\r\n"); #line 67 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 68 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" if (rel.A.Type.ImplementsIExportable() && rel.B.Type.ImplementsIExportable()) { #line 69 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <property name=\"ExportGuid\" column=\"`ExportGuid`\" type=\"Guid\" />\r\n"); #line 70 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 71 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" </class>\r\n"); #line 72 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 73 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects("\r\n"); this.WriteObjects(" <!-- ValueCollectionEntries are defined directly on use -->\r\n"); #line 76 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" foreach (var prop in ctx.GetQuery <ValueTypeProperty>() .Where(p => p.IsList && !p.IsCalculated) .Where(p => p.ObjectClass is ObjectClass) .ToList() .OrderBy(p => p.ObjectClass.Name) .ThenBy(p => p.Name)) { var collectionEntryNamespace = prop.GetCollectionEntryNamespace(); var collectionEntryClassName = prop.GetCollectionEntryClassName() + ImplementationSuffix; var proxyClassName = prop.GetCollectionEntryClassName() + "Proxy"; var schemaName = prop.Module.SchemaName; var tableName = prop.GetCollectionEntryTable(); var ceReverseKeyColumnName = prop.GetCollectionEntryReverseKeyColumnName(); #line 90 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <class name=\"", collectionEntryNamespace, ".", collectionEntryClassName, "+", proxyClassName, "\"\r\n"); this.WriteObjects(" proxy=\"", collectionEntryNamespace, ".", collectionEntryClassName, "+", proxyClassName, "\"\r\n"); this.WriteObjects(" table=\"`", tableName, "`\"\r\n"); this.WriteObjects(" schema=\"`", schemaName, "`\" >\r\n"); this.WriteObjects("\r\n"); #line 95 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" IdGeneratorHbm.Call(Host, "id", schemaName, tableName); #line 96 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects("\r\n"); this.WriteObjects(" <many-to-one name=\"Parent\"\r\n"); this.WriteObjects(" column=\"`", ceReverseKeyColumnName, "`\" />\r\n"); #line 99 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" ValueTypePropertyHbm.Call(Host, String.Empty, prop, "Value", prop.Name, true, ImplementationSuffix, false); #line 100 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" if (prop.HasPersistentOrder) { #line 101 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <property name=\"Value_pos\"\r\n"); this.WriteObjects(" column=\"`Index`\" />\r\n"); #line 103 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 104 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" if (((ObjectClass)prop.ObjectClass).ImplementsIExportable()) { #line 105 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <!-- export guid is not needed since serialization is always \"in-place\"\r\n"); this.WriteObjects(" <property name=\"ExportGuid\" column=\"`ExportGuid`\" type=\"Guid\" />\r\n"); this.WriteObjects(" -->\r\n"); #line 108 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 109 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" </class>\r\n"); this.WriteObjects("\r\n"); #line 111 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 112 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <!-- CompoundObjectCollectionEntries -->\r\n"); #line 114 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" foreach (var prop in ctx.GetQuery <CompoundObjectProperty>() .Where(p => p.IsList /* && !p.IsCalculated */) .Where(p => p.ObjectClass is ObjectClass) .ToList() .OrderBy(p => p.ObjectClass.Name) .ThenBy(p => p.Name)) { var collectionEntryNamespace = prop.GetCollectionEntryNamespace(); var collectionEntryClassName = prop.GetCollectionEntryClassName() + ImplementationSuffix; var proxyClassName = prop.GetCollectionEntryClassName() + "Proxy"; var schemaName = prop.Module.SchemaName; var tableName = prop.GetCollectionEntryTable(); var ceReverseKeyColumnName = prop.GetCollectionEntryReverseKeyColumnName(); #line 128 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <class name=\"", collectionEntryNamespace, ".", collectionEntryClassName, "+", proxyClassName, "\"\r\n"); this.WriteObjects(" proxy=\"", collectionEntryNamespace, ".", collectionEntryClassName, "+", proxyClassName, "\"\r\n"); this.WriteObjects(" table=\"`", tableName, "`\"\r\n"); this.WriteObjects(" schema=\"`", schemaName, "`\" >\r\n"); this.WriteObjects("\r\n"); #line 133 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" IdGeneratorHbm.Call(Host, "id", schemaName, tableName); #line 134 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects("\r\n"); this.WriteObjects(" <many-to-one name=\"Parent\"\r\n"); this.WriteObjects(" column=\"`", ceReverseKeyColumnName, "`\" />\r\n"); #line 137 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" CompoundObjectPropertyHbm.Call(Host, ctx, String.Empty, prop, "Value", prop.Name, true, ImplementationSuffix); #line 138 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" if (prop.HasPersistentOrder) { #line 139 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <property name=\"Value_pos\"\r\n"); this.WriteObjects(" column=\"`Index`\" />\r\n"); #line 141 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 142 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" if (((ObjectClass)prop.ObjectClass).ImplementsIExportable()) { #line 143 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" <!-- export guid is not needed since serialization is always \"in-place\"\r\n"); this.WriteObjects(" <property name=\"ExportGuid\" column=\"`ExportGuid`\" type=\"Guid\" />\r\n"); this.WriteObjects(" -->\r\n"); #line 146 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 147 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects(" </class>\r\n"); this.WriteObjects("\r\n"); #line 149 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" } #line 150 "P:\zetbox\Zetbox.DalProvider.NHibernate.Generator\Templates\Mappings\CollectionEntriesHbm.cst" this.WriteObjects("</hibernate-mapping>\r\n"); }