• Main Page
  • Classes
  • Files

FdoKgOraClassDefinition.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006  SL-King d.o.o
00003 * 
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of version 2.1 of the GNU Lesser
00006 * General Public License as published by the Free Software Foundation.
00007 * 
00008 * This library is distributed in the hope that it will be useful,
00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 * Lesser General Public License for more details.
00012 * 
00013 * You should have received a copy of the GNU Lesser General Public
00014 * License along with this library; if not, write to the Free Software
00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00016  */
00017 #ifndef FdoKgOraClassDefinition_H
00018 #define FdoKgOraClassDefinition_H
00019 
00020 #ifdef _WIN32
00021 #pragma once
00022 #endif //_WIN32
00023 
00024 #include <KingOracle/Override/FdoKgOraPropertyDefinitionCollection.h>
00025 
00026 class FdoKgOraClassDefinition : public FdoPhysicalClassMapping
00027 {
00028     typedef FdoPhysicalClassMapping BaseType;
00029 
00030 public:
00031     FDOKGORA_API static FdoKgOraClassDefinition* Create();
00032 
00033 public:
00034     FDOKGORA_API FdoKgOraPropertyDefinitionCollection* GetProperties() const;
00035     
00036     FDOKGORA_API FdoString* GetOracleFullTableName() const { return m_OracleTableFullName; }
00037     FDOKGORA_API void SetOracleFullTableName(FdoString * OracleFullName) { m_OracleTableFullName=OracleFullName; };
00038     
00039     FDOKGORA_API void SetUseSequenceForIdentity(FdoString * TableSequence) { m_UseSequenceForIdentity=TableSequence; };
00040     FDOKGORA_API FdoString* GetUseSequenceForIdentity() const { return m_UseSequenceForIdentity; }
00041     
00042     FDOKGORA_API void SetOraTableAliasNum(int AliasNum) { char tbuff[16]; sprintf(tbuff,"a%d",AliasNum);  m_OraTableAlias=tbuff; };
00043     FDOKGORA_API const char* GetOraTableAlias() { return  m_OraTableAlias; };
00044     
00045 
00046     FDOKGORA_API void SetPointGeometry(FdoString *GeomPropertyName, FdoString *X_OraColumn, FdoString *Y_OraColumn, FdoString *Z_OraColumn )
00047     {
00048       m_IsPointGeometry = true;  
00049       m_PoinGeometry_PropertyName = GeomPropertyName;
00050       m_PoinGeometry_X_OraColumn = X_OraColumn;
00051       m_PoinGeometry_Y_OraColumn = Y_OraColumn;
00052       m_PoinGeometry_Z_OraColumn = Z_OraColumn;
00053     }
00054     FDOKGORA_API void SetIsPointGeometry(bool IsPointGeometry)
00055     {
00056       m_IsPointGeometry = IsPointGeometry;  
00057     }
00058     FDOKGORA_API bool GetIsPointGeometry() { return m_IsPointGeometry; }
00059     FDOKGORA_API FdoString* GetPoinGeometryPropertyName() { return m_PoinGeometry_PropertyName; };
00060     FDOKGORA_API FdoString* GetPointXOraColumn() { return m_PoinGeometry_X_OraColumn; };
00061     FDOKGORA_API FdoString* GetPointYOraColumn() { return m_PoinGeometry_Y_OraColumn; };
00062     FDOKGORA_API FdoString* GetPointZOraColumn() { return m_PoinGeometry_Z_OraColumn; };
00063     
00064         
00065 
00066     FDOKGORA_API virtual void InitFromXml(FdoXmlSaxContext* Context, FdoXmlAttributeCollection* Attrs);
00067     FDOKGORA_API virtual FdoXmlSaxHandler* XmlStartElement(FdoXmlSaxContext* Context,FdoString* Uri, FdoString* Name, FdoString* QName, FdoXmlAttributeCollection* Attrs);
00068     FDOKGORA_API virtual FdoBoolean XmlEndElement(FdoXmlSaxContext* Context, FdoString* Uri, FdoString* Name, FdoString* QName);
00069     FDOKGORA_API virtual void _writeXml(FdoXmlWriter* Writer, const FdoXmlFlags* Flags);
00070 
00071     /// find property with column name
00072     FDOKGORA_API FdoKgOraPropertyDefinition* FindByColumnName(FdoString* ColumnName);
00073 
00074 protected:
00075     FdoKgOraClassDefinition(void);
00076     virtual ~FdoKgOraClassDefinition(void);
00077     virtual void Dispose(void);
00078 
00079 private:
00080       FdoStringP m_OracleTableFullName; // complete table name in Oracle (owner.table) for fdo class
00081       FdoStringP m_OraTableAlias; // table allias used for in SQL (generated in describe schema)
00082       FdoStringP m_UseSequenceForIdentity; // if this
00083       
00084       // Class can have geometry property defined not in standard way as column in oracle table (SDO_GEOMETRY)
00085       // but as point which is created from numeric colimns X,Y and/or Z
00086       bool m_IsPointGeometry; // true if geometry property is created
00087       FdoStringP m_PoinGeometry_PropertyName; // name of geometry property in fdo class- must be same as
00088       FdoStringP m_PoinGeometry_X_OraColumn;  // name of oracle column (number) which is used for X coordinate of point
00089       FdoStringP m_PoinGeometry_Y_OraColumn;  // name of oracle column (number) which is used for Y coordinate of point
00090       FdoStringP m_PoinGeometry_Z_OraColumn;  // name of oracle column (number) which is used for Z coordinate of point - can be empty for 2D points
00091       
00092     FdoKgOraPropertyDefinitionCollectionP m_Properties;
00093 };
00094 
00095 typedef FdoPtr<FdoKgOraClassDefinition> FdoKgOraClassDefinitionP;
00096 
00097 #endif // FdoKgOraClassDefinition_H
00098 
00099 
Please send us your comment about this page