From: Michael D. <mik...@us...> - 2004-06-03 13:32:00
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31802 Modified Files: Baz.hbm.xml NHibernate.DomainModel-1.1.csproj Qux.cs ReverseComparator.cs Added Files: LessSimple.cs MoreStuff.cs Po.cs Result.cs Several.cs Single.cs Stuff.cs Log Message: Continued to add Domain Classes for test fixtures. Index: NHibernate.DomainModel-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-1.1.csproj,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NHibernate.DomainModel-1.1.csproj 3 Jun 2004 03:23:33 -0000 1.13 --- NHibernate.DomainModel-1.1.csproj 3 Jun 2004 13:31:52 -0000 1.14 *************** *** 389,392 **** --- 389,397 ---- /> <File + RelPath = "LessSimple.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Location.hbm.xml" BuildAction = "EmbeddedResource" *************** *** 402,405 **** --- 407,415 ---- /> <File + RelPath = "MoreStuff.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Multiplicity.cs" SubType = "Code" *************** *** 448,451 **** --- 458,466 ---- /> <File + RelPath = "Po.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Qux.cs" SubType = "Code" *************** *** 457,460 **** --- 472,480 ---- /> <File + RelPath = "Result.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "ReverseComparator.cs" SubType = "Code" *************** *** 462,465 **** --- 482,490 ---- /> <File + RelPath = "Several.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "SexType.cs" SubType = "Code" *************** *** 489,492 **** --- 514,522 ---- /> <File + RelPath = "Single.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Sortable.cs" SubType = "Code" *************** *** 499,502 **** --- 529,537 ---- /> <File + RelPath = "Stuff.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Stuff.hbm.xml" BuildAction = "EmbeddedResource" --- NEW FILE: Single.cs --- using System; using System.Collections; namespace NHibernate.DomainModel { /// <summary> /// Summary description for Single. /// </summary> [Serializable] public class Single { private string _id; private string _prop; private string _string; private IDictionary _several; public string Id { get { return _id; } set { _id = value; } } public string Prop { get { return _prop; } set { _prop = value; } } public string String { get { return _string; } set { _string = value; } } public IDictionary Several { get { return _several; } set { _several = value; } } #region System.Object members public override bool Equals(object obj) { if(this==obj) return true; Single rhs = obj as Single; if(rhs==null) return false; return ( rhs.Id.Equals(this.Id) && rhs.String.Equals(this.String) ); } public override int GetHashCode() { return _id.GetHashCode(); } #endregion } } Index: ReverseComparator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/ReverseComparator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReverseComparator.cs 8 Apr 2004 17:22:08 -0000 1.1 --- ReverseComparator.cs 3 Jun 2004 13:31:52 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- namespace NHibernate.DomainModel { + [Serializable] public class ReverseComparator : IComparer { --- NEW FILE: Result.cs --- using System; namespace NHibernate.DomainModel { /// <summary> /// Summary description for Result. /// </summary> public class Result { private string _name; private long _amount; private int _count; public Result(string name, long amount, int count) { } public string Name { get { return _name; } set { _name = value; } } public long Amount { get { return _amount; } set { _amount = value; } } public int Count { get { return _count; } set { _count = value; } } } } --- NEW FILE: LessSimple.cs --- using System; using System.Collections; namespace NHibernate.DomainModel { /// <summary> /// Summary description for LessSimple. /// </summary> public class LessSimple : Simple { private int _intprop; private string _foo; //<set> mapping private IDictionary _set; private IList _bag; private Simple _another; private LessSimple _yetAnother; private Po _myPo; public int Intprop { get { return _intprop; } set { _intprop = value; } } public string Foo { get { return _foo; } set { _foo = value; } } public IDictionary Set { get { return _set; } set { _set = value; } } public IList Bag { get { return _bag; } set { _bag = value; } } public Simple Another { get { return _another; } set { _another = value; } } public LessSimple YetAnother { get { return _yetAnother; } set { _yetAnother = value; } } public Po MyPo { get { return _myPo; } set { _myPo = value; } } } } Index: Qux.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Qux.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Qux.cs 8 Apr 2004 14:59:32 -0000 1.1 --- Qux.cs 3 Jun 2004 13:31:52 -0000 1.2 *************** *** 4,8 **** namespace NHibernate.DomainModel { ! public class Qux : ILifecycle { --- 4,8 ---- namespace NHibernate.DomainModel { ! //TODO: fix up property names public class Qux : ILifecycle { *************** *** 17,20 **** --- 17,22 ---- } + #region ILifecycle members + public LifecycleVeto OnSave(ISession session) { *************** *** 53,57 **** this.session=session; } ! public void store() { --- 55,66 ---- this.session=session; } ! ! public LifecycleVeto OnUpdate(ISession s) ! { ! return LifecycleVeto.NoVeto; ! } ! ! #endregion ! public void store() { *************** *** 281,288 **** } ! public LifecycleVeto OnUpdate(ISession s) ! { ! return LifecycleVeto.NoVeto; ! } } } \ No newline at end of file --- 290,294 ---- } ! } } \ No newline at end of file --- NEW FILE: Stuff.cs --- using System; namespace NHibernate.DomainModel { /// <summary> /// Summary description for Stuff. /// </summary> [Serializable] public class Stuff { private long _id; private FooProxy _foo; private MoreStuff _moreStuff; //private TimeZone property; TODO - does this exists in .net??? public long Id { get { return _id; } set { _id = value; } } public FooProxy Foo { get { return _foo; } set { _foo = value; } } public MoreStuff MoreStuff { get { return _moreStuff; } set { _moreStuff = value; } } #region System.Object Members public override bool Equals(object obj) { if(this==obj) return true; Stuff rhs = obj as Stuff; if(rhs==null) return false; return rhs.Id.Equals(this.Id) && rhs.Foo.key.Equals(_foo.key) && rhs.MoreStuff.Equals(_moreStuff) ; } public override int GetHashCode() { return _id.GetHashCode(); } #endregion } } Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.hbm.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Baz.hbm.xml 2 Jun 2004 04:53:24 -0000 1.8 --- Baz.hbm.xml 3 Jun 2004 13:31:52 -0000 1.9 *************** *** 232,235 **** --- 232,236 ---- <bag name="Floats" table="baz_floats_bag"> <key column="baz_compon_id"/> + <!-- TODO: fix this to a Single --> <element type="Int64" column="float_value"/> </bag> --- NEW FILE: MoreStuff.cs --- using System; using System.Collections; namespace NHibernate.DomainModel { /// <summary> /// Summary description for MoreStuff. /// </summary> [Serializable] public class MoreStuff { private string _stringId; private int _intId; // <bag> mapping private ICollection _stuffs; private string _name; public string StringId { get { return _stringId; } set { _stringId = value; } } public int IntId { get { return _intId; } set { _intId = value; } } public ICollection Stuffs { get { return _stuffs; } set { _stuffs = value; } } public string Name { get { return _name; } set { _name = value; } } #region System.Object Members public override bool Equals(object obj) { if(this==obj) return true; MoreStuff rhs = obj as MoreStuff; if(rhs==null) return false; return ( rhs.IntId==this.IntId && rhs.StringId.Equals(this.StringId) ); } public override int GetHashCode() { return _stringId.GetHashCode(); } #endregion } } --- NEW FILE: Po.cs --- using System; using System.Collections; namespace NHibernate.DomainModel { /// <summary> /// Summary description for Po. /// </summary> public class Po { private long _id; private string _value; //<set> mapping private IDictionary _set; public long Id { get {return _id;} set {_id = value;} } public string Value { get {return _value;} set {_value = value;} } public IDictionary Set { get {return _set;} set {_set = value;} } } } --- NEW FILE: Several.cs --- using System; namespace NHibernate.DomainModel { /// <summary> /// Summary description for Several. /// </summary> [Serializable] public class Several { private string _id; private string _prop; private float _single; private string _string; public string Id { get { return _id; } set { _id = value; } } public string Prop { get { return _prop; } set { _prop = value; } } public float Single { get { return _single; } set { _single = value; } } public string String { get { return _string; } set { _string = value; } } #region System.Object members public override bool Equals(object obj) { if(this==obj) return true; Several rhs = obj as Several; if(rhs==null) return false; return ( rhs.Id.Equals(this.Id) && rhs.String.Equals(this.String) ); } public override int GetHashCode() { return _id.GetHashCode(); } #endregion } } |