00001 #ifndef FDO_RDBMSOVOBJECTPROPERTYDEFINITION_H
00002 #define FDO_RDBMSOVOBJECTPROPERTYDEFINITION_H
00003 //
00004 //
00005 // Copyright (C) 2004-2006 Autodesk, Inc.
00006 //
00007 // This library is free software; you can redistribute it and/or
00008 // modify it under the terms of version 2.1 of the GNU Lesser
00009 // General Public License as published by the Free Software Foundation.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00019 //
00020
00021 /// <library>
00022 /// FdoRdbms.lib
00023 /// </library>
00024
00025 #include <Rdbms/Override/RdbmsOv.h>
00026 #include <Rdbms/Override/RdbmsOvPropertyDefinition.h>
00027 #include <Rdbms/Override/RdbmsOvPropertyMappingClass.h>
00028 #include <Rdbms/Override/RdbmsOvPropertyMappingConcrete.h>
00029 #include <Rdbms/Override/RdbmsOvPropertyMappingSingle.h>
00030
00031 ///<summary>Abstract class defining physical schema overrides for an object property
00032 ///definition.</summary>
00033 class FdoRdbmsOvObjectPropertyDefinition : virtual public FdoRdbmsOvPropertyDefinition
00034 {
00035 public:
00036 ///<summary>Gets the object property mapping definition</summary>
00037 /// <returns>Returns FdoRdbmsOvPropertyMappingDefinition</returns>
00038 FDORDBMS_OV_API FdoRdbmsOvPropertyMappingDefinition* GetMappingDefinition();
00039
00040 //DOM-IGNORE-BEGIN
00041
00042 // XML Serialization functions, not part of API.
00043
00044 // Initialize this element from its XML attributes
00045 FDORDBMS_OV_API virtual void InitFromXml(
00046 FdoXmlSaxContext* pContext,
00047 FdoXmlAttributeCollection* attrs,
00048 FdoString* mappingType,
00049 FdoXmlAttributeCollection* mappingAttrs
00050 );
00051
00052 // Create and optionally attach a Single table property mapping.
00053 FDORDBMS_OV_API virtual FdoRdbmsOvPropertyMappingSingle* CreateSingleMapping(
00054 bool attach // if true then make the new mapping the property mapping for
00055 // this object property. Replaces any previous mapping
00056 )
00057 {
00058 return NULL;
00059 //TODO: exception
00060 }
00061
00062 // Create and optionally attach a Class table property mapping.
00063 FDORDBMS_OV_API virtual FdoRdbmsOvPropertyMappingClass* CreateClassMapping(
00064 bool attach // if true then make the new mapping the property mapping for
00065 // this object property. Replaces any previous mapping
00066 )
00067 {
00068 return NULL;
00069 //TODO: exception
00070 }
00071
00072 // Create and optionally attach a Concrete table property mapping.
00073 FDORDBMS_OV_API virtual FdoRdbmsOvPropertyMappingConcrete* CreateConcreteMapping(
00074 bool attach // if true then make the new mapping the property mapping for
00075 // this object property. Replaces any previous mapping
00076 )
00077 {
00078 return NULL;
00079 //TODO: exception
00080 }
00081
00082 //DOM-IGNORE-END
00083
00084
00085 protected:
00086 FDORDBMS_OV_API FdoRdbmsOvObjectPropertyDefinition();
00087 FDORDBMS_OV_API FdoRdbmsOvObjectPropertyDefinition(FdoString* name);
00088 FDORDBMS_OV_API virtual ~FdoRdbmsOvObjectPropertyDefinition();
00089
00090 // Sets the object property mapping
00091 FDORDBMS_OV_API void SetMappingDefinition(FdoRdbmsOvPropertyMappingDefinition* propertyMappingDefinition);
00092
00093 // Serialize provider-specific parts of this override to XML.
00094 FDORDBMS_OV_API virtual void _writeXmlContents(FdoXmlWriter* xmlWriter, const FdoXmlFlags* flags);
00095
00096 private:
00097 FdoRdbmsOvPropertyMappingP mPropertyMappingDefinition;
00098 };
00099
00100 ///<summary>FdoRdbmsOvObjectPropertyP is a FdoPtr on FdoRdbmsOvObjectPropertyDefinition, provided for convenience.</summary>
00101 typedef FdoPtr<FdoRdbmsOvObjectPropertyDefinition> FdoRdbmsOvObjectPropertyP;
00102
00103 #endif
00104