From: John M. <joh...@us...> - 2005-02-11 22:54:15
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7306/src/NHibernate.Tool.Net2Hbm Modified Files: MapGenerator.cs NHibernate.Tool.Net2Hbm-1.1.csproj Log Message: Added a collection one to many attribute. Index: MapGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/MapGenerator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MapGenerator.cs 30 Dec 2004 16:54:02 -0000 1.1 --- MapGenerator.cs 11 Feb 2005 22:54:01 -0000 1.2 *************** *** 176,179 **** --- 176,180 ---- WriteCollectionKey( writer, property ); WriteCollectionIndex( writer, property ); + WriteCollectionOneToMany( writer, property ); WriteCollectionCompositeElement( writer, property ); WriteCollectionManyToMany( writer, property ); *************** *** 194,197 **** --- 195,199 ---- if( attribute.IsLazy ) writer.WriteAttributeString( "lazy", "true" ); WriteCollectionKey( writer, property ); + WriteCollectionOneToMany( writer, property ); WriteCollectionCompositeElement( writer, property ); writer.WriteEndElement(); //<list> *************** *** 284,287 **** --- 286,305 ---- } } + + /// <summary> + /// Writes the collection one to many tag. + /// </summary> + /// <param name="writer"></param> + /// <param name="property"></param> + private void WriteCollectionOneToMany( XmlWriter writer, PropertyInfo property ) + { + CollectionOneToManyAttribute attribute = (CollectionOneToManyAttribute)Attribute.GetCustomAttribute( property, typeof(CollectionOneToManyAttribute) ); + if( attribute != null ) + { + writer.WriteStartElement( "one-to-many" ); + writer.WriteAttributeString( "class", GetShortTypeName( attribute.Type ) ); + writer.WriteEndElement(); //<one-to-many> + } + } /// <summary> Index: NHibernate.Tool.Net2Hbm-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/NHibernate.Tool.Net2Hbm-1.1.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NHibernate.Tool.Net2Hbm-1.1.csproj 30 Jan 2005 15:04:37 -0000 1.2 --- NHibernate.Tool.Net2Hbm-1.1.csproj 11 Feb 2005 22:54:01 -0000 1.3 *************** *** 125,128 **** --- 125,133 ---- /> <File + RelPath = "CollectionOneToManyAttribute.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "DiscriminatorAttribute.cs" SubType = "Code" |