All,
Please can someone help me with this problem. I am creating a XPO class generator that takes a database (I will call it the ERD) and from it creates a set of classes. Abstract classes to define the database and non-abstract classes to contain meta data and business rules. All meta data to create the XPO classes with virtual properties, default values, null able values, aggregated fields, locking schemas etc. etc. is taken from the ERD, the idea here is that the ERD is leading (and thus the database) and not the XPO classes.
There is one thing I cannot get working, is I define a 0/1-N relation in the abstract class, then the runtime will create the database, but it will trip with an error. The error is:
failed: DevExpress.Xpo.Exceptions.AssociationInvalidException : There is a malformed association 'FK_Child_FK_Parent'. Cannot find the associated member for 'Profix.UltraSimple.Database.AChild.Parent' in the class 'Profix.UltraSimple.Database.Parent'
at DevExpress.Xpo.Metadata.XPMemberInfo.GetAssociatedMember()
at DevExpress.Xpo.Metadata.XPMemberInfo.ProcessAssociationRefChange(Session session, Object referenceMemberOwner, Object oldValue, Object newValue, Boolean skipNonLoadedCollections)
at DevExpress.Xpo.Session.TriggerObjectChanged(Object changedObject, ObjectChangeEventArgs e)
C:\Work\VS_ProfixXpoTools\ConsoleBasedXpoGenData\UltraSimple\Generated.All\AChild.cs(677,0): at Profix.UltraSimple.Database.AChild.set_Parent(Parent value)
C:\Work\VS_ProfixXpoTools\ConsoleBasedXpoGenData\UltraSimple\UnitTestUltraSimple.cs(32,0): at Profix.UnitTestsUltraSimple.CreateCTest()
Has anyone any idea how to make this work? That is: define the relation in the abstract class with the types (in the relation) referring to the non-abstract class.
The code defining the relations is:
In the class Child:
// GetAbstractGenAssociation0NsGetSetMember
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.ForeignKeys.Parent)]
[DevExpress.Xpo.AssociationAttribute(Profix.UltraSimple.Database.Parent.Associations.ChildListByParent, typeof(Profix.UltraSimple.Database.AParent))]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public Parent Parent
{
get
{
return this._fkParent;
}
set
{
if (this._fkParent != value)
{
Parent fkParent = this._fkParent;
this._fkParent = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Parent, fkParent, this._fkParent);
}
}
}
In the class Parent:
// GetAbstractGenAssociation0NsGetCollections
[DevExpress.Xpo.AssociationAttribute(Profix.UltraSimple.Database.Parent.Associations.ChildListByParent, typeof(Profix.UltraSimple.Database.AChild))]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public DevExpress.Xpo.XPCollection<Profix.UltraSimple.Database.Child> ChildListByParent
{
get
{
DevExpress.Xpo.XPCollection<Profix.UltraSimple.Database.Child> aoChildListByParent
= this.GetCollection<Profix.UltraSimple.Database.Child>(Profix.UltraSimple.Database.Parent.Properties.ChildListByParent);
return aoChildListByParent;
}
}
All code needed to make the data objects workable follows (7 source files).
Regards,
Frans de Wit
BTW: For anyone interested, I am willing to make this an open source project. With sufficient interest I will create a project on ‘www.codeplex.com’.
using System;
using DevExpress.Xpo;
namespace Profix
{
public class ProfixSession
{
public static Session DefaultSession
{
get
{
return Session.DefaultSession;
}
}
}
public interface IProfixXPCustomObject
{
bool IsNew
{
get;
}
bool IsConstructionFinished
{
get;
}
}
[NonPersistent]
public abstract class AProfixXPCustomObject : XPCustomObject
{
public AProfixXPCustomObject(Session poSession)
: base(poSession)
{
}
}
}
using System;
// === ============================================================ ===
// === Generator: GetAbstractGen ===
// === GenDate : 7/3/2009 4:14:14 PM ===
// === Version : 0.0.0.4(Beta) ===
// === ============================================================ ===
namespace Profix.UltraSimple.Database
{
[DevExpress.Xpo.PersistentAttribute("Parent")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public abstract class AParent : Profix.AProfixXPCustomObject, Profix.IProfixXPCustomObject
{
#region Protected
// GetAbstractGenProtectedOverrideVoidOnSaving
protected override void OnSaving()
{
if (this.IsNew)
{
if (this.IsConstructionFinished && (this._guidOid == Guid.Empty))
this._guidOid = DevExpress.Xpo.XpoDefault.NewGuid();
}
base.OnSaving();
}
#endregion // Protected
#region Internal
#endregion // Internal
#region Private
private int _nIsNew;
private bool _lIsConstructionFinished;
// GetAbstractGenPrivateFields(1)
[DevExpress.Xpo.KeyAttribute(true)]
[DevExpress.Xpo.PersistentAttribute("PK")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
[System.ComponentModel.BrowsableAttribute(false)]
private Guid _guidOid;
// GetAbstractGenPrivateFields(2)
private string _sText;
#endregion // Private
#region Public
// GetAbstractGenConstructor1AllColumnsInclusiveDefaults
public AParent(
DevExpress.Xpo.Session poSession
, string psText)
: base(poSession)
{
this.Text = psText;
}
// GetAbstractGenConstructor5OnlyTheSessionParameter
public AParent(DevExpress.Xpo.Session poSession)
: base(poSession)
{
}
// GetAbstractGenPublicGetOid
[DevExpress.Xpo.PersistentAliasAttribute("_guidOid")]
[System.ComponentModel.BrowsableAttribute(false)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public Guid Oid
{
get
{
if (this.IsNew && this.IsConstructionFinished && (this._guidOid == Guid.Empty))
this._guidOid = DevExpress.Xpo.XpoDefault.NewGuid();
return this._guidOid;
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Parent.Properties.Text)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public string Text
{
get
{
return this._sText;
}
set
{
if (this._sText != value)
{
string sText = this._sText;
this._sText = value;
this.OnChanged(Profix.UltraSimple.Database.Parent.Properties.Text, sText, this._sText);
}
}
}
// GetAbstractGenAssociation0NsGetCollections
[DevExpress.Xpo.AssociationAttribute(Profix.UltraSimple.Database.Parent.Associations.ChildListByParent, typeof(Profix.UltraSimple.Database.AChild))]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public DevExpress.Xpo.XPCollection<Profix.UltraSimple.Database.Child> ChildListByParent
{
get
{
DevExpress.Xpo.XPCollection<Profix.UltraSimple.Database.Child> aoChildListByParent
= this.GetCollection<Profix.UltraSimple.Database.Child>(Profix.UltraSimple.Database.Parent.Properties.ChildListByParent);
return aoChildListByParent;
}
}
public override void AfterConstruction()
{
base.AfterConstruction();
this._lIsConstructionFinished = true;
}
[DevExpress.Xpo.NonPersistentAttribute()]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public bool IsNew
{
get
{
if (this._nIsNew == 0)
this._nIsNew = base.Session.IsNewObject(this) ? 2 : 1;
return this._nIsNew == 2;
}
}
[DevExpress.Xpo.NonPersistentAttribute()]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public bool IsConstructionFinished
{
get
{
return this._lIsConstructionFinished;
}
}
#endregion // Public
}
}
using System;
// === ============================================================ ===
// === Generator: GetImplementationGen ===
// === GenDate : 7/3/2009 4:14:14 PM ===
// === Version : 0.0.0.4(Beta) ===
// === ============================================================ ===
namespace Profix.UltraSimple.Database
{
[DevExpress.Xpo.MapInheritanceAttribute(DevExpress.Xpo.MapInheritanceType.ParentTable)]
[DevExpress.Xpo.DeferredDeletionAttribute(true)]
[DevExpress.Xpo.OptimisticLockingAttribute(true)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public partial class Parent : AParent
{
#region Protected
#endregion // Protected
#region Internal
#endregion // Internal
#region Private
#endregion // Private
#region Public
// GetImplementationGenPublicStaticClassAssociations
public static class Associations
{
public const string ChildListByParent = "FK_Child_FK_Parent";
}
// GetImplementationGenPublicStaticClassFields(1)
public static DevExpress.Xpo.PersistentBase.FieldsClass BaseFields
{
get { return DevExpress.Xpo.PersistentBase.Fields; }
}
// GetImplementationGenPublicStaticClassFields(2)
public new static class Fields
{
public static DevExpress.Data.Filtering.OperandProperty Text { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Parent.Properties.Text); } }
}
// GetImplementationGenPublicStaticClassProperties
public static class Properties
{
public const string Text = "Text";
public const string ChildListByParent = "ChildListByParent";
}
// GetImplementationGenConstructor1AllColumnsInclusiveDefaults
public Parent(
DevExpress.Xpo.Session poSession
, string psText)
: base(poSession, psText)
{
}
// GetImplementationGenConstructor5OnlyTheSessionParameter
public Parent(DevExpress.Xpo.Session poSession)
: base(poSession)
{
}
// GetImplementationGenConstructor6ObsoleteNoSessionParameter
[System.ObsoleteAttribute("Constructor only to be used for deserialization", true)]
public Parent()
: base(Profix.ProfixSession.DefaultSession)
{
}
#endregion // Public
}
}
using System;
// === ============================================================ ===
// === Generator: GetImplementationImp ===
// === GenDate : 7/2/2009 3:19:00 PM ===
// === Version : 0.0.0.4(Beta) ===
// === ============================================================ ===
namespace Profix.UltraSimple.All.Database
{
public partial class Parent
{
#region Protected
#endregion // Protected
#region Internal
#endregion // Internal
#region Private
#endregion // Private
#region Public
#endregion // Public
}
}
using System;
// === ============================================================ ===
// === Generator: GetAbstractGen ===
// === GenDate : 7/3/2009 4:14:14 PM ===
// === Version : 0.0.0.4(Beta) ===
// === ============================================================ ===
namespace Profix.UltraSimple.Database
{
[DevExpress.Xpo.PersistentAttribute("Child")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public abstract class AChild : Profix.AProfixXPCustomObject, Profix.IProfixXPCustomObject
{
#region Protected
// GetAbstractGenProtectedOverrideVoidOnSaving
protected override void OnSaving()
{
if (this.IsNew)
{
if ((this._lLocalMemo1 == false) && (this._lSavedMemo1 == false))
this.Memo1 = this._sMemo1;
if ((this._lLocalMemo2 == false) && (this._lSavedMemo2 == false))
this.Memo2 = this._sMemo2;
if (this._lSavedMemo5 == false)
this.Memo5 = this._lLocalMemo5 ? this._sMemo5 : Profix.UltraSimple.Database.Child.Defaults.Memo5;
if (this._lSavedMemo6 == false)
this.Memo6 = this._lLocalMemo6 ? this._sMemo6 : Profix.UltraSimple.Database.Child.Defaults.Memo6;
if (this.IsConstructionFinished && (this._guidOid == Guid.Empty))
this._guidOid = DevExpress.Xpo.XpoDefault.NewGuid();
}
base.OnSaving();
}
#endregion // Protected
#region Internal
#endregion // Internal
#region Private
private int _nIsNew;
private bool _lIsConstructionFinished;
// GetAbstractGenPrivateFields(1)
[DevExpress.Xpo.KeyAttribute(true)]
[DevExpress.Xpo.PersistentAttribute("PK")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
[System.ComponentModel.BrowsableAttribute(false)]
private Guid _guidOid;
// GetAbstractGenPrivateFields(2)
private Parent _fkParent;
private string _sText1;
private string _sText2;
private string _sText3;
private string _sText4;
private string _sText5;
private string _sText6;
private string _sMemo1;
private string _sMemo2;
private string _sMemo3;
private string _sMemo4;
private string _sMemo5;
private string _sMemo6;
// GetAbstractGenPrivateFields(3)
private bool _lLocalMemo1;
private bool _lSavedMemo1;
private bool _lLocalMemo2;
private bool _lSavedMemo2;
private bool _lLocalMemo5;
private bool _lSavedMemo5;
private bool _lLocalMemo6;
private bool _lSavedMemo6;
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Text2)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
private string PrivateText2
{
get
{
return this._sText2;
}
set
{
if (this._sText2 != value)
{
string sText2 = this._sText2;
this._sText2 = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Text2, sText2, this._sText2);
}
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Text4)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
[System.ComponentModel.DefaultValueAttribute(Profix.UltraSimple.Database.Child.Defaults.Text4)]
private string PrivateText4
{
get
{
return this._sText4;
}
set
{
if (this._sText4 != value)
{
string sText4 = this._sText4;
this._sText4 = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Text4, sText4, this._sText4);
}
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Text6)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
private string PrivateText6
{
get
{
return this._sText6;
}
set
{
if (this._sText6 != value)
{
string sText6 = this._sText6;
this._sText6 = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Text6, sText6, this._sText6);
}
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(DevExpress.Xpo.SizeAttribute.Unlimited)]
[DevExpress.Xpo.DbTypeAttribute("nvarchar(MAX)")]
[DevExpress.Xpo.DelayedAttribute()]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Memo2)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
private string PrivateMemo2
{
get
{
if (this._lLocalMemo2)
return this._sMemo2;
this._sMemo2 = this.GetDelayedPropertyValue<string>("PrivateMemo2");
this._lLocalMemo2 = true;
this._lSavedMemo2 = true;
return this._sMemo2;
}
set
{
if ((this._lLocalMemo2 == false) || (this._lSavedMemo2 == false) || (this._sMemo2 != value))
{
bool lDoSave = (this._lSavedMemo2 == false) || (this._sMemo2 != value);
this._sMemo2 = value;
this._lLocalMemo2 = true;
if (lDoSave)
{
this._lSavedMemo2 = true;
this.SetDelayedPropertyValue<string>("PrivateMemo2", value);
}
}
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(DevExpress.Xpo.SizeAttribute.Unlimited)]
[DevExpress.Xpo.DbTypeAttribute("nvarchar(MAX)")]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Memo4)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
private string PrivateMemo4
{
get
{
return this._sMemo4;
}
set
{
if (this._sMemo4 != value)
{
string sMemo4 = this._sMemo4;
this._sMemo4 = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Memo4, sMemo4, this._sMemo4);
}
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(DevExpress.Xpo.SizeAttribute.Unlimited)]
[DevExpress.Xpo.DbTypeAttribute("nvarchar(MAX)")]
[DevExpress.Xpo.DelayedAttribute()]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Memo6)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
[System.ComponentModel.DefaultValueAttribute(Profix.UltraSimple.Database.Child.Defaults.Memo6)]
private string PrivateMemo6
{
get
{
if (this._lLocalMemo6)
return this._sMemo6;
if (this.IsNew)
{
this._sMemo6 = Profix.UltraSimple.Database.Child.Defaults.Memo6;
this._lSavedMemo6 = false;
}
else
{
this._sMemo6 = this.GetDelayedPropertyValue<string>("PrivateMemo6");
this._lSavedMemo6 = true;
}
this._lLocalMemo6 = true;
return this._sMemo6;
}
set
{
if ((this._lLocalMemo6 == false) || (this._lSavedMemo6 == false) || (this._sMemo6 != value))
{
bool lDoSave = (this._lSavedMemo6 == false) || (this._sMemo6 != value);
this._sMemo6 = value;
this._lLocalMemo6 = true;
if (lDoSave)
{
this._lSavedMemo6 = true;
this.SetDelayedPropertyValue<string>("PrivateMemo6", value);
}
}
}
}
#endregion // Private
#region Public
// GetAbstractGenConstructor1AllColumnsInclusiveDefaults
public AChild(
DevExpress.Xpo.Session poSession
, Parent pfkParent
, string psText1
, string psText2
, string psText3
, string psText4
, string psText5
, string psText6
, string psMemo1
, string psMemo2
, string psMemo3
, string psMemo4
, string psMemo5
, string psMemo6)
: base(poSession)
{
if (psText3 == null)
throw new ArgumentNullException("psText3", "psText3 == null");
if (psText4 == null)
throw new ArgumentNullException("psText4", "psText4 == null");
if (psText5 == null)
throw new ArgumentNullException("psText5", "psText5 == null");
if (psText6 == null)
throw new ArgumentNullException("psText6", "psText6 == null");
if (psMemo5 == null)
throw new ArgumentNullException("psMemo5", "psMemo5 == null");
if (psMemo6 == null)
throw new ArgumentNullException("psMemo6", "psMemo6 == null");
this.Parent = pfkParent;
this.Text1 = psText1;
this.Text2 = psText2;
this.Text3 = psText3;
this.Text4 = psText4;
this.Text5 = psText5;
this.Text6 = psText6;
this.Memo1 = psMemo1;
this.Memo2 = psMemo2;
this.Memo3 = psMemo3;
this.Memo4 = psMemo4;
this.Memo5 = psMemo5;
this.Memo6 = psMemo6;
}
// GetAbstractGenConstructor2AllColumnsExclusiveDefaults
public AChild(
DevExpress.Xpo.Session poSession
, Parent pfkParent
, string psText1
, string psText2
, string psText5
, string psText6
, string psMemo1
, string psMemo2
, string psMemo3
, string psMemo4)
: base(poSession)
{
if (psText5 == null)
throw new ArgumentNullException("psText5", "psText5 == null");
if (psText6 == null)
throw new ArgumentNullException("psText6", "psText6 == null");
this.Parent = pfkParent;
this.Text1 = psText1;
this.Text2 = psText2;
this.Text3 = Profix.UltraSimple.Database.Child.Defaults.Text3;
this.Text4 = Profix.UltraSimple.Database.Child.Defaults.Text4;
this.Text5 = psText5;
this.Text6 = psText6;
this.Memo1 = psMemo1;
this.Memo2 = psMemo2;
this.Memo3 = psMemo3;
this.Memo4 = psMemo4;
}
// GetAbstractGenConstructor3NonNullableColumnsInclusiveDefaults
public AChild(
DevExpress.Xpo.Session poSession
, string psText3
, string psText4
, string psText5
, string psText6
, string psMemo5
, string psMemo6)
: base(poSession)
{
if (psText3 == null)
throw new ArgumentNullException("psText3", "psText3 == null");
if (psText4 == null)
throw new ArgumentNullException("psText4", "psText4 == null");
if (psText5 == null)
throw new ArgumentNullException("psText5", "psText5 == null");
if (psText6 == null)
throw new ArgumentNullException("psText6", "psText6 == null");
if (psMemo5 == null)
throw new ArgumentNullException("psMemo5", "psMemo5 == null");
if (psMemo6 == null)
throw new ArgumentNullException("psMemo6", "psMemo6 == null");
this.Text3 = psText3;
this.Text4 = psText4;
this.Text5 = psText5;
this.Text6 = psText6;
this.Memo5 = psMemo5;
this.Memo6 = psMemo6;
}
// GetAbstractGenConstructor4NonNullableColumnsExclusiveDefaults
public AChild(
DevExpress.Xpo.Session poSession
, string psText5
, string psText6)
: base(poSession)
{
if (psText5 == null)
throw new ArgumentNullException("psText5", "psText5 == null");
if (psText6 == null)
throw new ArgumentNullException("psText6", "psText6 == null");
this.Text3 = Profix.UltraSimple.Database.Child.Defaults.Text3;
this.Text4 = Profix.UltraSimple.Database.Child.Defaults.Text4;
this.Text5 = psText5;
this.Text6 = psText6;
}
// GetAbstractGenConstructor5OnlyTheSessionParameter
public AChild(DevExpress.Xpo.Session poSession)
: base(poSession)
{
}
// GetAbstractGenPublicGetOid
[DevExpress.Xpo.PersistentAliasAttribute("_guidOid")]
[System.ComponentModel.BrowsableAttribute(false)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public Guid Oid
{
get
{
if (this.IsNew && this.IsConstructionFinished && (this._guidOid == Guid.Empty))
this._guidOid = DevExpress.Xpo.XpoDefault.NewGuid();
return this._guidOid;
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Text1)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public string Text1
{
get
{
return this._sText1;
}
set
{
if (this._sText1 != value)
{
string sText1 = this._sText1;
this._sText1 = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Text1, sText1, this._sText1);
}
}
}
// GetAbstractGenGettersAndSetters(2)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAliasAttribute("PrivateText2")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public virtual string Text2
{
get
{
return this.PrivateText2;
}
set
{
this.PrivateText2 = value;
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Text3)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
[System.ComponentModel.DefaultValueAttribute(Profix.UltraSimple.Database.Child.Defaults.Text3)]
public string Text3
{
get
{
return this._sText3;
}
set
{
if (this._sText3 != value)
{
string sText3 = this._sText3;
this._sText3 = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Text3, sText3, this._sText3);
}
}
}
// GetAbstractGenGettersAndSetters(2)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAliasAttribute("PrivateText4")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
[System.ComponentModel.DefaultValueAttribute(Profix.UltraSimple.Database.Child.Defaults.Text4)]
public virtual string Text4
{
get
{
return this.PrivateText4;
}
set
{
this.PrivateText4 = value;
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Text5)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public string Text5
{
get
{
return this._sText5;
}
set
{
if (this._sText5 != value)
{
string sText5 = this._sText5;
this._sText5 = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Text5, sText5, this._sText5);
}
}
}
// GetAbstractGenGettersAndSetters(2)
[DevExpress.Xpo.SizeAttribute(50)]
[DevExpress.Xpo.DbTypeAttribute("nchar(50)")]
[DevExpress.Xpo.PersistentAliasAttribute("PrivateText6")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public virtual string Text6
{
get
{
return this.PrivateText6;
}
set
{
this.PrivateText6 = value;
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(DevExpress.Xpo.SizeAttribute.Unlimited)]
[DevExpress.Xpo.DbTypeAttribute("nvarchar(MAX)")]
[DevExpress.Xpo.DelayedAttribute()]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Memo1)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public string Memo1
{
get
{
if (this._lLocalMemo1)
return this._sMemo1;
this._sMemo1 = this.GetDelayedPropertyValue<string>("Memo1");
this._lLocalMemo1 = true;
this._lSavedMemo1 = true;
return this._sMemo1;
}
set
{
if ((this._lLocalMemo1 == false) || (this._lSavedMemo1 == false) || (this._sMemo1 != value))
{
bool lDoSave = (this._lSavedMemo1 == false) || (this._sMemo1 != value);
this._sMemo1 = value;
this._lLocalMemo1 = true;
if (lDoSave)
{
this._lSavedMemo1 = true;
this.SetDelayedPropertyValue<string>("Memo1", value);
}
}
}
}
// GetAbstractGenGettersAndSetters(2)
[DevExpress.Xpo.SizeAttribute(DevExpress.Xpo.SizeAttribute.Unlimited)]
[DevExpress.Xpo.DbTypeAttribute("nvarchar(MAX)")]
[DevExpress.Xpo.DelayedAttribute()]
[DevExpress.Xpo.PersistentAliasAttribute("PrivateMemo2")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public virtual string Memo2
{
get
{
return this.PrivateMemo2;
}
set
{
this.PrivateMemo2 = value;
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(DevExpress.Xpo.SizeAttribute.Unlimited)]
[DevExpress.Xpo.DbTypeAttribute("nvarchar(MAX)")]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Memo3)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public string Memo3
{
get
{
return this._sMemo3;
}
set
{
if (this._sMemo3 != value)
{
string sMemo3 = this._sMemo3;
this._sMemo3 = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Memo3, sMemo3, this._sMemo3);
}
}
}
// GetAbstractGenGettersAndSetters(2)
[DevExpress.Xpo.SizeAttribute(DevExpress.Xpo.SizeAttribute.Unlimited)]
[DevExpress.Xpo.DbTypeAttribute("nvarchar(MAX)")]
[DevExpress.Xpo.PersistentAliasAttribute("PrivateMemo4")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public virtual string Memo4
{
get
{
return this.PrivateMemo4;
}
set
{
this.PrivateMemo4 = value;
}
}
// GetAbstractGenGettersAndSetters(1)
[DevExpress.Xpo.SizeAttribute(DevExpress.Xpo.SizeAttribute.Unlimited)]
[DevExpress.Xpo.DbTypeAttribute("nvarchar(MAX)")]
[DevExpress.Xpo.DelayedAttribute()]
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.Properties.Memo5)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
[System.ComponentModel.DefaultValueAttribute(Profix.UltraSimple.Database.Child.Defaults.Memo5)]
public string Memo5
{
get
{
if (this._lLocalMemo5)
return this._sMemo5;
if (this.IsNew)
{
this._sMemo5 = Profix.UltraSimple.Database.Child.Defaults.Memo5;
this._lSavedMemo5 = false;
}
else
{
this._sMemo5 = this.GetDelayedPropertyValue<string>("Memo5");
this._lSavedMemo5 = true;
}
this._lLocalMemo5 = true;
return this._sMemo5;
}
set
{
if ((this._lLocalMemo5 == false) || (this._lSavedMemo5 == false) || (this._sMemo5 != value))
{
bool lDoSave = (this._lSavedMemo5 == false) || (this._sMemo5 != value);
this._sMemo5 = value;
this._lLocalMemo5 = true;
if (lDoSave)
{
this._lSavedMemo5 = true;
this.SetDelayedPropertyValue<string>("Memo5", value);
}
}
}
}
// GetAbstractGenGettersAndSetters(2)
[DevExpress.Xpo.SizeAttribute(DevExpress.Xpo.SizeAttribute.Unlimited)]
[DevExpress.Xpo.DbTypeAttribute("nvarchar(MAX)")]
[DevExpress.Xpo.DelayedAttribute()]
[DevExpress.Xpo.PersistentAliasAttribute("PrivateMemo6")]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
[System.ComponentModel.DefaultValueAttribute(Profix.UltraSimple.Database.Child.Defaults.Memo6)]
public virtual string Memo6
{
get
{
return this.PrivateMemo6;
}
set
{
this.PrivateMemo6 = value;
}
}
// GetAbstractGenAssociation0NsGetSetMember
[DevExpress.Xpo.PersistentAttribute(Profix.UltraSimple.Database.Child.ForeignKeys.Parent)]
[DevExpress.Xpo.AssociationAttribute(Profix.UltraSimple.Database.Parent.Associations.ChildListByParent, typeof(Profix.UltraSimple.Database.AParent))]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public Parent Parent
{
get
{
return this._fkParent;
}
set
{
if (this._fkParent != value)
{
Parent fkParent = this._fkParent;
this._fkParent = value;
this.OnChanged(Profix.UltraSimple.Database.Child.Properties.Parent, fkParent, this._fkParent);
}
}
}
public override void AfterConstruction()
{
base.AfterConstruction();
this._lIsConstructionFinished = true;
}
[DevExpress.Xpo.NonPersistentAttribute()]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public bool IsNew
{
get
{
if (this._nIsNew == 0)
this._nIsNew = base.Session.IsNewObject(this) ? 2 : 1;
return this._nIsNew == 2;
}
}
[DevExpress.Xpo.NonPersistentAttribute()]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(false)]
public bool IsConstructionFinished
{
get
{
return this._lIsConstructionFinished;
}
}
#endregion // Public
}
}
using System;
// === ============================================================ ===
// === Generator: GetImplementationGen ===
// === GenDate : 7/3/2009 4:14:14 PM ===
// === Version : 0.0.0.4(Beta) ===
// === ============================================================ ===
namespace Profix.UltraSimple.Database
{
[DevExpress.Xpo.MapInheritanceAttribute(DevExpress.Xpo.MapInheritanceType.ParentTable)]
[DevExpress.Xpo.DeferredDeletionAttribute(true)]
[DevExpress.Xpo.OptimisticLockingAttribute(true)]
[DevExpress.Xpo.MemberDesignTimeVisibilityAttribute(true)]
public partial class Child : AChild
{
#region Protected
#endregion // Protected
#region Internal
#endregion // Internal
#region Private
#endregion // Private
#region Public
// GetImplementationGenPublicStaticClassFields(1)
public static DevExpress.Xpo.PersistentBase.FieldsClass BaseFields
{
get { return DevExpress.Xpo.PersistentBase.Fields; }
}
// GetImplementationGenPublicStaticClassFields(2)
public new static class Fields
{
public static DevExpress.Data.Filtering.OperandProperty Parent { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Parent); } }
public static DevExpress.Data.Filtering.OperandProperty Text1 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Text1); } }
public static DevExpress.Data.Filtering.OperandProperty Text2 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Text2); } }
public static DevExpress.Data.Filtering.OperandProperty Text3 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Text3); } }
public static DevExpress.Data.Filtering.OperandProperty Text4 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Text4); } }
public static DevExpress.Data.Filtering.OperandProperty Text5 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Text5); } }
public static DevExpress.Data.Filtering.OperandProperty Text6 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Text6); } }
public static DevExpress.Data.Filtering.OperandProperty Memo1 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Memo1); } }
public static DevExpress.Data.Filtering.OperandProperty Memo2 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Memo2); } }
public static DevExpress.Data.Filtering.OperandProperty Memo3 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Memo3); } }
public static DevExpress.Data.Filtering.OperandProperty Memo4 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Memo4); } }
public static DevExpress.Data.Filtering.OperandProperty Memo5 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Memo5); } }
public static DevExpress.Data.Filtering.OperandProperty Memo6 { get { return new DevExpress.Data.Filtering.OperandProperty(Profix.UltraSimple.Database.Child.Properties.Memo6); } }
}
// GetImplementationGenPublicStaticClassForeignKeys
public static class ForeignKeys
{
public const string Parent = "FK_Parent";
}
// GetImplementationGenPublicStaticClassProperties
public static class Properties
{
public const string Parent = "Parent";
public const string Text1 = "Text1";
public const string Text2 = "Text2";
public const string Text3 = "Text3";
public const string Text4 = "Text4";
public const string Text5 = "Text5";
public const string Text6 = "Text6";
public const string Memo1 = "Memo1";
public const string Memo2 = "Memo2";
public const string Memo3 = "Memo3";
public const string Memo4 = "Memo4";
public const string Memo5 = "Memo5";
public const string Memo6 = "Memo6";
}
// GetImplementationGenPublicStaticClassDefaultValues
public static class Defaults
{
public const string Text3 = "Default value for Text3";
public const string Text4 = "Default value for Text4";
public const string Memo5 = "Default value for the Memo5 column";
public const string Memo6 = "Default value for the Memo6 column";
}
// GetImplementationGenConstructor1AllColumnsInclusiveDefaults
public Child(
DevExpress.Xpo.Session poSession
, Parent pfkParent
, string psText1
, string psText2
, string psText3
, string psText4
, string psText5
, string psText6
, string psMemo1
, string psMemo2
, string psMemo3
, string psMemo4
, string psMemo5
, string psMemo6)
: base(poSession, pfkParent, psText1, psText2, psText3, psText4, psText5, psText6, psMemo1, psMemo2, psMemo3, psMemo4, psMemo5, psMemo6)
{
}
// GetImplementationGenConstructor2AllColumnsExclusiveDefaults
public Child(
DevExpress.Xpo.Session poSession
, Parent pfkParent
, string psText1
, string psText2
, string psText5
, string psText6
, string psMemo1
, string psMemo2
, string psMemo3
, string psMemo4)
: base(poSession, pfkParent, psText1, psText2, psText5, psText6, psMemo1, psMemo2, psMemo3, psMemo4)
{
}
// GetImplementationGenConstructor3NonNullableColumnsInclusiveDefaults
public Child(
DevExpress.Xpo.Session poSession
, string psText3
, string psText4
, string psText5
, string psText6
, string psMemo5
, string psMemo6)
: base(poSession, psText3, psText4, psText5, psText6, psMemo5, psMemo6)
{
}
// GetImplementationGenConstructor4NonNullableColumnsExclusiveDefaults
public Child(
DevExpress.Xpo.Session poSession
, string psText5
, string psText6)
: base(poSession, psText5, psText6)
{
}
// GetImplementationGenConstructor6ObsoleteNoSessionParameter
[System.ObsoleteAttribute("Constructor only to be used for deserialization", true)]
public Child()
: base(Profix.ProfixSession.DefaultSession)
{
}
// GetImplementationGenConstructor7ObsoleteOnlyTheSessionParameter
[System.ObsoleteAttribute("Constructor only to be used for deserialization", true)]
public Child(DevExpress.Xpo.Session poSession)
: base(poSession)
{
}
#endregion // Public
}
}
using System;
// === ============================================================ ===
// === Generator: GetImplementationImp ===
// === GenDate : 7/2/2009 3:19:00 PM ===
// === Version : 0.0.0.4(Beta) ===
// === ============================================================ ===
namespace Profix.UltraSimple.All.Database
{
public partial class Child
{
#region Protected
#endregion // Protected
#region Internal
#endregion // Internal
#region Private
#endregion // Private
#region Public
#endregion // Public
}
}