DPS/DataPlatform/DataAttribute.h

120 lines
5.0 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "DPData.h"
class DataAttribute:public DPData
{
Q_OBJECT
Q_PROPERTY(QString displayName READ getDisplayName WRITE setDisplayName)
Q_PROPERTY(QString InternalName READ getInternalName WRITE setInternalName)
Q_PROPERTY(QString description READ getDes WRITE setDes)
Q_PROPERTY(int createVerion READ getCreateVersion WRITE setCreateVersion)
Q_PROPERTY(int deleteVerion READ getDeleteVersion WRITE setDeleteVersion)
Q_PROPERTY(QString defaultValue READ getDefaultValue WRITE setDefaultValue)
Q_PROPERTY(int dataType READ getDataType WRITE setDataType)
Q_PROPERTY(int isIndex READ getIsIndex WRITE setIsIndex)
Q_PROPERTY(int isOnly READ getIsOnly WRITE setIsOnly)
Q_PROPERTY(int isAutoIncrement READ getIsAutoincrement WRITE setIsAutoincrement)
Q_PROPERTY(int maxLen READ getMaxLen WRITE setMaxLen)
Q_PROPERTY(int minLen READ getMinLen WRITE setMinLen)
Q_PROPERTY(int numLen READ getNumLen WRITE setNumLen)
Q_PROPERTY(int numPresision READ getNumPresision WRITE setNumPresision)
Q_PROPERTY(int isFindKey READ getIsFindkey WRITE setIsFindkey)
Q_PROPERTY(int fkTableId READ getFKTableId WRITE setFKTableId)
Q_PROPERTY(int fkType READ getFKType WRITE setFKType)
Q_PROPERTY(int isPK READ getIsPK WRITE setIsPK)
public:
DataAttribute();
~DataAttribute();
void setDisplayName(QString displayName) { _strDisplayName = displayName; }
QString getDisplayName() const { return _strDisplayName; }
void setInternalName(QString name) { _strInternalName = name; }
QString getInternalName() const { return _strInternalName; }
void setDes(QString des) { _strDescription = des; }
QString getDes() const { return _strDescription; }
void setCreateVersion(int cVersion) { _wCreateVersion = cVersion; }
int getCreateVersion() const { return _wCreateVersion; }
void setDeleteVersion(int dVersion) { _wDeleteVersion = dVersion; }
int getDeleteVersion() const { return _wDeleteVersion; }
void setDefaultValue(QString value) { _strDefaultValue = value; }
QString getDefaultValue() const { return _strDefaultValue; }
void setDataType(int type) { _wDataType = type; }
int getDataType() const { return _wDataType; }
void setIsIndex(int bIs) { _wIsIndex = bIs; }
int getIsIndex() const { return _wIsIndex; }
void setIsOnly(int bIs) { _wIsOnly = bIs; }
int getIsOnly() const { return _wIsOnly; }
void setIsAutoincrement(int bIs) { _wIsAutoincrement = bIs; }
int getIsAutoincrement() const { return _wIsAutoincrement; }
void setMaxLen(int len) { _wMaxLength = len; }
unsigned int getMaxLen() const { return _wMaxLength; }
void setMinLen(int len) { _wMinLength = len; }
int getMinLen() const { return _wMinLength; }
void setNumLen(int len) { _wNumLength = len; }
int getNumLen() const { return _wNumLength; }
void setNumPresision(int presision) { _wNumPresision = presision; }
int getNumPresision() const { return _wNumPresision; }
void setIsFindkey(int bIs) { _wIsFindKey = bIs; }
int getIsFindkey() const { return _wIsFindKey; }
void setFKTableId(int id) { _wFkTableID = id; }
int getFKTableId() const { return _wFkTableID; }
int getFKType() const { return _FKType; }
void setFKType(int fkType) { _FKType = fkType; }
int getIsPK() const { return _isPrimaryKey; }
void setIsPK(int bIs) { _isPrimaryKey = bIs; }
/*<2A><><EFBFBD><EFBFBD><E6B1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
bool saveSelf();
void saveToDao();
/*ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
bool deleteSelf();
/*<2A><><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>*/
void loadData(DBPlatformSpace::DAO* pDao);
/*<2A><>ȡ<EFBFBD>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>*/
void getNewProperty(json& parameter, QVariantMap& valueMap);
void setNewData(json& parameter);
void toJson(json& jsonObj, bool recursive = false);
//<2F>޸<EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void reName();
//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD>Ʊ<EFBFBD>ʶ<EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD>
bool checkNameillegal(QString& errMsg);
bool checkNameSize(int min, int max, QString& errMsg);
bool checkLetter(QString& errmsg, int index); //<2F>жϵڼ<CFB5><DABC><EFBFBD><EFBFBD>ַ<EFBFBD>
bool illegalName(QString& errMsg); //<2F><>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD>Ʊ<EFBFBD>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void checkImportAttributeName(DPData* pParent);
void setFileData(FileGenerate* generator, QStringList flag);
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
// bool copyToDstDataClass(int dataClassID, DataAttribute*& newData);
QString _displayfield; //[2023014add]<5D><><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>༭ģ<E0BCAD><C4A3><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>
QString _strDisplayName; //<2F><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
QString _strInternalName; //<2F>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD><EFBFBD>
QString _strDescription; //<2F><><EFBFBD><EFBFBD>
int _wCreateVersion = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD>
int _wDeleteVersion = 0; //ɾ<><C9BE><EFBFBD>
QString _strDefaultValue;
int _wDataType = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD> 2<>ַ<EFBFBD><D6B7><EFBFBD> 3 ʵ<>ͣ<EFBFBD>
int _wIsIndex = 0; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int _wIsOnly = 0; //<2F>Ƿ<EFBFBD>Ψһ
int _wIsAutoincrement = 0 ; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
int _wMaxLength = 0; //<2F><><EFBFBD>󳤶<EFBFBD>
int _wMinLength = 0; //<2F><>С<EFBFBD><D0A1><EFBFBD><EFBFBD>
int _wNumLength = 0; //<2F><>ֵλ<D6B5><CEBB>
int _wNumPresision = 0; //<2F><>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
int _wIsFindKey = 0; //<2F>Ƿ<EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// unsigned int _type = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>0 <20><>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD> 1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int _FKType = 0; //0<><30> <20><>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD> 1: 1<><31>1<EFBFBD><31>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2 :1<><31>n<EFBFBD><6E>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD>
int _wFkTableID = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>id
QString _fkname; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ʱΪ<CAB1><CEAA><EFBFBD><EFBFBD>ʱʹ<CAB1>ã<EFBFBD>
int _isPrimaryKey = 0; //<2F>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
protected:
private:
};