Exposed JADE Classes

Each exposed JADE class is:

If the exposed JADE class is a subclass of another exposed JADE class, the class hierarchy is retained in the C# definition; for example, if SubClass1 is a subclass of Class1 in the JADE definition, the C# class SubClass1 is derived from Class1.

With the addition of create methods with parameters in JADE 2018, the constructors of exposed classes will change, depending on the create method of classes. If an exposed JADE class has a create method with parameters, the two constructors defined in the previous paragraph also include parameters to match the create method of the class.

The data type of these parameters is based on the JADE type. To work correctly, any non‑primitive parameters require their class to be exposed. The conversions for JADE primitive types are the same as those for properties. For details, see "Exposed JADE Properties", in the following section.

The following example shows an exposed JADE class.

[System.Runtime.Serialization.KnownTypeAttribute(typeof(Tender))]
[System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
[System.ComponentModel.DataAnnotations.MetadataTypeAttribute(typeof
    (TenderSaleMetadata))]
[JadeSoftware.Joob.Client.JoobClassAttribute("TenderSale",
    "RootSchema.CommonSchema.ErewhonInvestmentsModelSchema",
    ClassNamespace="ErewhonTesting")]
[JadeSoftware.Joob.Metadata.JomlTypeAttribute
    (JadeSoftware.Joob.Metadata.JomlTypeKind.Class, "TenderSale", typeof
    JoobObject))]
public partial class TenderSale: Sale
{
    private static TenderSaleMetadata _metaModel;
    partial void _initialize();
    static TenderSale()
    {
        _metaModel = MetadataCache<TenderSaleMetadata>.GetData(null);
    }
    public TenderSale():
        this(JadeSoftware.Joob.ClassPersistence.Persistent)
    {
    }
    public TenderSale(JadeSoftware.Joob.ClassPersistence lifetime):
        base(lifetime, typeof(TenderSale), _metaModel.metaClass)
    {
        this._initialize();
    }
    protected TenderSale(JadeSoftware.Joob.ClassPersistence lifetime,
        System.Type type, JadeSoftware.Joob.ClassMetadata metaClass):
        base(lifetime, type, metaClass)
    {
        this._initialize();
    }

#region Jade Properties
#region Jade Methods
#region Jade Constants
}

The generated classes are decorated with a number of attributes, which are used by the JADE engine to ensure correct and consistent access to the class in the JADE database. For each exposed class, an additional class is generated, which is used internally to ensure consistency between the JADE database definition and the C# definition. The name of this class is formed by appending Metadata to the name of the exposed class. For example, if the TenderSale class is exposed, the class is named TenderSaleMetadata.