Skip to content
Browse files

Class Tabela renamed to Table.

  • Loading branch information...
1 parent 1ab0432 commit 01c9211857eb9dd81c4d63ad1d5d3053666cd867 @rkhaotix rkhaotix committed Dec 20, 2012
Showing with 321 additions and 321 deletions.
  1. +1 −1 libobjrenderer/src/ogsubitemobjeto.cpp
  2. +1 −1 libobjrenderer/src/ogsubitemobjeto.h
  3. +2 −2 libobjrenderer/src/ogtabela.cpp
  4. +2 −2 libobjrenderer/src/ogtabela.h
  5. +1 −1 libobjrenderer/src/ogtituloobjeto.h
  6. +2 −2 libpgmodeler/libpgmodeler.pro
  7. +54 −54 libpgmodeler/src/modelobd.cpp
  8. +10 −10 libpgmodeler/src/modelobd.h
  9. +9 −9 libpgmodeler/src/operationlist.cpp
  10. +1 −1 libpgmodeler/src/pgsqltypes.h
  11. +2 −2 libpgmodeler/src/reference.cpp
  12. +4 −4 libpgmodeler/src/reference.h
  13. +44 −44 libpgmodeler/src/relationship.cpp
  14. +13 −13 libpgmodeler/src/relationship.h
  15. +7 −7 libpgmodeler/src/sequence.cpp
  16. +2 −2 libpgmodeler/src/sequence.h
  17. +88 −88 libpgmodeler/src/{tabela.cpp → table.cpp}
  18. +15 −15 libpgmodeler/src/{tabela.h → table.h}
  19. +2 −2 libpgmodeler/src/view.cpp
  20. +1 −1 libpgmodeler/src/view.h
  21. +2 −2 libpgmodeler_ui/src/funcaowidget.cpp
  22. +2 −2 libpgmodeler_ui/src/gatilhowidget.cpp
  23. +1 −1 libpgmodeler_ui/src/gatilhowidget.h
  24. +1 −1 libpgmodeler_ui/src/indicewidget.cpp
  25. +1 −1 libpgmodeler_ui/src/indicewidget.h
  26. +20 −20 libpgmodeler_ui/src/modelowidget.cpp
  27. +1 −1 libpgmodeler_ui/src/objetobasewidget.cpp
  28. +1 −1 libpgmodeler_ui/src/objetobasewidget.h
  29. +1 −1 libpgmodeler_ui/src/regrawidget.cpp
  30. +1 −1 libpgmodeler_ui/src/regrawidget.h
  31. +1 −1 libpgmodeler_ui/src/relacionamentowidget.cpp
  32. +1 −1 libpgmodeler_ui/src/relacionamentowidget.h
  33. +5 −5 libpgmodeler_ui/src/restricaowidget.cpp
  34. +15 −15 libpgmodeler_ui/src/tabelawidget.cpp
  35. +1 −1 libpgmodeler_ui/src/tabelawidget.h
  36. +4 −4 libpgmodeler_ui/src/visaoobjetoswidget.cpp
  37. +2 −2 libpgmodeler_ui/src/visaowidget.cpp
View
2 libobjrenderer/src/ogsubitemobjeto.cpp
@@ -423,7 +423,7 @@ QString OGSubItemObjeto::obterStringRestricoes(Column *coluna)
{
if(coluna && coluna->getParentTable())
{
- Tabela *tabela=dynamic_cast<Tabela *>(coluna->getParentTable());
+ Table *tabela=dynamic_cast<Table *>(coluna->getParentTable());
QString str_rest;
Constraint *restricao=NULL;
vector<Constraint *>::iterator itr,itr_end;
View
2 libobjrenderer/src/ogsubitemobjeto.h
@@ -23,7 +23,7 @@
#define OG_SUBITEM_OBJETO_H
#include "view.h"
-#include "tabela.h"
+#include "table.h"
#include "objetografico.h"
class OGSubItemObjeto: public ObjetoGrafico
View
4 libobjrenderer/src/ogtabela.cpp
@@ -1,6 +1,6 @@
#include "ogtabela.h"
-OGTabela::OGTabela(Tabela *tabela) : OGTabelaBase(tabela)
+OGTabela::OGTabela(Table *tabela) : OGTabelaBase(tabela)
{
connect(tabela, SIGNAL(s_objectModified(void)), this, SLOT(configurarObjeto(void)));
@@ -124,7 +124,7 @@ void OGTabela::hoverMoveEvent(QGraphicsSceneHoverEvent *evento)
void OGTabela::configurarObjeto(void)
{
- Tabela *tabela=dynamic_cast<Tabela *>(this->obterObjetoOrigem());
+ Table *tabela=dynamic_cast<Table *>(this->obterObjetoOrigem());
QPolygonF pol;
int i, qtd, idx;
float larg, larg_tipo=0, px=0;
View
4 libobjrenderer/src/ogtabela.h
@@ -23,7 +23,7 @@
#ifndef OG_TABELA_H
#define OG_TABELA_H
-#include "tabela.h"
+#include "table.h"
#include "ogtabelabase.h"
#include "ogtituloobjeto.h"
#include "ogsubitemobjeto.h"
@@ -51,7 +51,7 @@ class OGTabela: public OGTabelaBase {
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
public:
- OGTabela(Tabela *tabela);
+ OGTabela(Table *tabela);
~OGTabela(void);
private slots:
View
2 libobjrenderer/src/ogtituloobjeto.h
@@ -23,7 +23,7 @@
#define OG_TITULO_OBJETO_H
#include "view.h"
-#include "tabela.h"
+#include "table.h"
#include "objetografico.h"
class OGTituloObjeto: public ObjetoGrafico
View
4 libpgmodeler/libpgmodeler.pro
@@ -33,7 +33,7 @@ HEADERS += $$PWD/src/textbox.h \
$$PWD/src/index.h \
$$PWD/src/basegraphicobject.h \
$$PWD/src/relationship.h \
- $$PWD/src/tabela.h \
+ $$PWD/src/table.h \
$$PWD/src/view.h \
$$PWD/src/operatorfamily.h \
$$PWD/src/operatorclasselement.h \
@@ -66,7 +66,7 @@ SOURCES += $$PWD/src/textbox.cpp \
$$PWD/src/function.cpp \
$$PWD/src/modelobd.cpp \
$$PWD/src/rule.cpp \
- $$PWD/src/tabela.cpp \
+ $$PWD/src/table.cpp \
$$PWD/src/cast.cpp \
$$PWD/src/aggregate.cpp \
$$PWD/src/baseobject.cpp \
View
108 libpgmodeler/src/modelobd.cpp
@@ -165,7 +165,7 @@ void ModeloBD::adicionarObjeto(BaseObject *objeto, int idx_obj)
else if(tipo_obj==OBJ_TEXTBOX)
adicionarCaixaTexto(dynamic_cast<Textbox *>(objeto), idx_obj);
else if(tipo_obj==OBJ_TABLE)
- adicionarTabela(dynamic_cast<Tabela *>(objeto), idx_obj);
+ adicionarTabela(dynamic_cast<Table *>(objeto), idx_obj);
else if(tipo_obj==OBJ_FUNCTION)
adicionarFuncao(dynamic_cast<Function *>(objeto), idx_obj);
else if(tipo_obj==OBJ_AGGREGATE)
@@ -223,7 +223,7 @@ void ModeloBD::removerObjeto(BaseObject *objeto, int idx_obj)
else if(tipo_obj==OBJ_TEXTBOX)
removerCaixaTexto(dynamic_cast<Textbox *>(objeto), idx_obj);
else if(tipo_obj==OBJ_TABLE)
- removerTabela(dynamic_cast<Tabela *>(objeto), idx_obj);
+ removerTabela(dynamic_cast<Table *>(objeto), idx_obj);
else if(tipo_obj==OBJ_FUNCTION)
removerFuncao(dynamic_cast<Function *>(objeto), idx_obj);
else if(tipo_obj==OBJ_AGGREGATE)
@@ -288,7 +288,7 @@ void ModeloBD::removerObjeto(unsigned idx_obj, ObjectType tipo_obj)
if(tipo_obj==OBJ_TEXTBOX)
removerCaixaTexto(dynamic_cast<Textbox *>(objeto), idx_obj);
else if(tipo_obj==OBJ_TABLE)
- removerTabela(dynamic_cast<Tabela *>(objeto), idx_obj);
+ removerTabela(dynamic_cast<Table *>(objeto), idx_obj);
else if(tipo_obj==OBJ_FUNCTION)
removerFuncao(dynamic_cast<Function *>(objeto), idx_obj);
else if(tipo_obj==OBJ_AGGREGATE)
@@ -716,7 +716,7 @@ void ModeloBD::destruirObjetos(void)
}
}
-void ModeloBD::adicionarTabela(Tabela *tabela, int idx_obj)
+void ModeloBD::adicionarTabela(Table *tabela, int idx_obj)
{
try
{
@@ -734,12 +734,12 @@ void ModeloBD::adicionarTabela(Tabela *tabela, int idx_obj)
}
}
-Tabela *ModeloBD::obterTabela(unsigned idx_obj)
+Table *ModeloBD::obterTabela(unsigned idx_obj)
{
- return(dynamic_cast<Tabela *>(obterObjeto(idx_obj, OBJ_TABLE)));
+ return(dynamic_cast<Table *>(obterObjeto(idx_obj, OBJ_TABLE)));
}
-void ModeloBD::removerTabela(Tabela *tabela, int idx_obj)
+void ModeloBD::removerTabela(Table *tabela, int idx_obj)
{
if(tabela)
{
@@ -871,13 +871,13 @@ void ModeloBD::removerVisao(View *visao, int idx_obj)
}
-void ModeloBD::atualizarRelFkTabela(Tabela *tabela)
+void ModeloBD::atualizarRelFkTabela(Table *tabela)
{
if(!tabela)
throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__);
else
{
- Tabela *ref_tab=NULL;
+ Table *ref_tab=NULL;
BaseRelationship *rel=NULL;
Constraint *fk=NULL;
unsigned idx;
@@ -895,7 +895,7 @@ void ModeloBD::atualizarRelFkTabela(Tabela *tabela)
while(itr!=itr_end)
{
fk=(*itr);
- ref_tab=dynamic_cast<Tabela *>(fk->getReferencedTable());
+ ref_tab=dynamic_cast<Table *>(fk->getReferencedTable());
itr++;
rel=obterRelacionamento(tabela, ref_tab);
@@ -923,7 +923,7 @@ void ModeloBD::atualizarRelFkTabela(Tabela *tabela)
if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK &&
rel->getTable(BaseRelationship::SRC_TABLE)==tabela)
{
- ref_tab=dynamic_cast<Tabela *>(rel->getTable(BaseRelationship::DST_TABLE));
+ ref_tab=dynamic_cast<Table *>(rel->getTable(BaseRelationship::DST_TABLE));
//Caso a visão não referencie mais a tabela
if(!tabela->referenciaTabelaChaveEstrangeira(ref_tab))
@@ -947,7 +947,7 @@ void ModeloBD::atualizarRelFkTabela(Tabela *tabela)
while(itr!=itr_end)
{
fk=(*itr);
- ref_tab=dynamic_cast<Tabela *>(fk->getReferencedTable());
+ ref_tab=dynamic_cast<Table *>(fk->getReferencedTable());
itr++;
/* Caso a tabela exista, um relacionamento tabela-visão será automaticamente criado
@@ -966,7 +966,7 @@ void ModeloBD::atualizarRelFkTabela(Tabela *tabela)
void ModeloBD::atualizarRelTabelaVisao(View *visao)
{
- Tabela *tab=NULL;
+ Table *tab=NULL;
BaseRelationship *rel=NULL;
Reference ref;
unsigned i, qtd_ref, idx;
@@ -1023,9 +1023,9 @@ void ModeloBD::atualizarRelTabelaVisao(View *visao)
{
//Obtém a tabela do relacionamento
if(rel->getTable(BaseRelationship::SRC_TABLE)->getObjectType()==OBJ_TABLE)
- tab=dynamic_cast<Tabela *>(rel->getTable(BaseRelationship::SRC_TABLE));
+ tab=dynamic_cast<Table *>(rel->getTable(BaseRelationship::SRC_TABLE));
else
- tab=dynamic_cast<Tabela *>(rel->getTable(BaseRelationship::DST_TABLE));
+ tab=dynamic_cast<Table *>(rel->getTable(BaseRelationship::DST_TABLE));
//Caso a visão não referencie mais a tabela
if(!visao->isReferencingTable(tab))
@@ -1321,7 +1321,7 @@ void ModeloBD::validarRelacionamentos(void)
rel_base=dynamic_cast<BaseRelationship *>(*itr);
if(rel_base->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK)
- this->atualizarRelFkTabela(dynamic_cast<Tabela *>(rel_base->getTable(BaseRelationship::SRC_TABLE)));
+ this->atualizarRelFkTabela(dynamic_cast<Table *>(rel_base->getTable(BaseRelationship::SRC_TABLE)));
itr++;
}
@@ -1358,7 +1358,7 @@ void ModeloBD::verificarRedundanciaRelacoes(Relationship *rel)
tipo_rel==Relationship::RELATIONSHIP_DEP))
{
BaseTable *tabela_ref=NULL, *tab_orig=NULL;
- Tabela *tabela_rec=NULL;
+ Table *tabela_rec=NULL;
Relationship *rel_aux=NULL;
BaseRelationship *rel_base=NULL;
vector<BaseObject *>::iterator itr, itr_end;
@@ -1441,7 +1441,7 @@ void ModeloBD::obterXMLObjetosEspeciais(void)
vector<BaseObject *>::iterator itr, itr_end;
Sequence *sequencia=NULL;
- Tabela *tabela=NULL;
+ Table *tabela=NULL;
TableObject *obj_tab=NULL;
Constraint *restricao=NULL;
Index *indice=NULL;
@@ -1462,7 +1462,7 @@ void ModeloBD::obterXMLObjetosEspeciais(void)
while(itr!=itr_end)
{
//Obtém a tabela a partir do iterador atual
- tabela=dynamic_cast<Tabela *>(*itr);
+ tabela=dynamic_cast<Table *>(*itr);
itr++;
//Varre as listas de restrição e índice
@@ -4599,16 +4599,16 @@ Aggregate *ModeloBD::criarFuncaoAgregacao(void)
return(func_agreg);
}
-Tabela *ModeloBD::criarTabela(void)
+Table *ModeloBD::criarTabela(void)
{
map<QString, QString> atributos;
QString elem;
- Tabela *tabela=NULL;
+ Table *tabela=NULL;
TableObject *objeto=NULL;
try
{
- tabela=new Tabela;
+ tabela=new Table;
//Lê do parser os atributos basicos
definirAtributosBasicos(tabela);
@@ -4722,7 +4722,7 @@ Constraint *ModeloBD::criarRestricao(BaseObject *objeto)
map<QString, QString> atributos;
Constraint *restricao=NULL;
BaseObject *tabela_ref=NULL;
- Tabela *tabela=NULL,*tabela_aux=NULL;
+ Table *tabela=NULL,*tabela_aux=NULL;
Column *coluna=NULL;
Relationship *relacao=NULL;
QString elem, str_aux;
@@ -4743,7 +4743,7 @@ Constraint *ModeloBD::criarRestricao(BaseObject *objeto)
{
tipo_objeto=objeto->getObjectType();
if(tipo_objeto==OBJ_TABLE)
- tabela=dynamic_cast<Tabela *>(objeto);
+ tabela=dynamic_cast<Table *>(objeto);
else if(tipo_objeto==OBJ_RELATIONSHIP)
relacao=dynamic_cast<Relationship *>(objeto);
else
@@ -4755,7 +4755,7 @@ Constraint *ModeloBD::criarRestricao(BaseObject *objeto)
else
{
tipo_objeto=OBJ_TABLE;
- tabela=dynamic_cast<Tabela *>(obterObjeto(atributos[ParsersAttributes::TABLE], OBJ_TABLE));
+ tabela=dynamic_cast<Table *>(obterObjeto(atributos[ParsersAttributes::TABLE], OBJ_TABLE));
ins_rest_tabela=true;
/* Caso a tabela a qual possua a restição não for encontrada uma exceção será disparada pois
não se pode criar uma restrição sem que esta seja atribuida a uma tabela, neste caso. */
@@ -4935,7 +4935,7 @@ Constraint *ModeloBD::criarRestricao(BaseObject *objeto)
}
else
{
- tabela_aux=dynamic_cast<Tabela *>(tabela_ref);
+ tabela_aux=dynamic_cast<Table *>(tabela_ref);
coluna=tabela_aux->obterColuna(lista_cols[i]);
//Caso a coluna não for encontrada, tenta obtê-la referenciando seu nome antigo
if(!coluna)
@@ -4982,7 +4982,7 @@ Constraint *ModeloBD::criarRestricao(BaseObject *objeto)
return(restricao);
}
-Index *ModeloBD::criarIndice(Tabela *tabela)
+Index *ModeloBD::criarIndice(Table *tabela)
{
map<QString, QString> atributos;
Index *indice=NULL;
@@ -5000,7 +5000,7 @@ Index *ModeloBD::criarIndice(Tabela *tabela)
if(!tabela)
{
inc_ind_tabela=true;
- tabela=dynamic_cast<Tabela *>(obterObjeto(atributos[ParsersAttributes::TABLE], OBJ_TABLE));
+ tabela=dynamic_cast<Table *>(obterObjeto(atributos[ParsersAttributes::TABLE], OBJ_TABLE));
/* Caso a tabela a qual possua a restição não for encontrada uma exceção será disparada pois
não se pode criar uma restrição sem que esta seja atribuida a uma tabela, neste caso. */
if(!tabela)
@@ -5212,7 +5212,7 @@ Rule *ModeloBD::criarRegra(void)
return(regra);
}
-Trigger *ModeloBD::criarGatilho(Tabela *tabela)
+Trigger *ModeloBD::criarGatilho(Table *tabela)
{
map<QString, QString> atributos;
Trigger *gatilho=NULL;
@@ -5233,7 +5233,7 @@ Trigger *ModeloBD::criarGatilho(Tabela *tabela)
else if(!tabela && !atributos[ParsersAttributes::TABLE].isEmpty())
{
inc_gat_tabela=true;
- tabela=dynamic_cast<Tabela *>(obterObjeto(atributos[ParsersAttributes::TABLE], OBJ_TABLE));
+ tabela=dynamic_cast<Table *>(obterObjeto(atributos[ParsersAttributes::TABLE], OBJ_TABLE));
if(!tabela)
throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL))
.arg(QString::fromUtf8(atributos[ParsersAttributes::NAME]))
@@ -5451,11 +5451,11 @@ Sequence *ModeloBD::criarSequencia(bool ignorar_possuidora)
}
//Tenta obter a coluna da tabela com o nome vindo do XML
- coluna=dynamic_cast<Tabela *>(tabela)->obterColuna(nome_col);
+ coluna=dynamic_cast<Table *>(tabela)->obterColuna(nome_col);
//Caso a coluna não for encontrada tenta obtê-la referenciando o antigo nome
if(!coluna)
- coluna=dynamic_cast<Tabela *>(tabela)->obterColuna(nome_col, true);
+ coluna=dynamic_cast<Table *>(tabela)->obterColuna(nome_col, true);
/* Caso a coluna não exista porém a mesma esteja sendo referenciada no xml
um erro será disparado */
@@ -5486,7 +5486,7 @@ View *ModeloBD::criarVisao(void)
map<QString, QString> atributos;
View *visao=NULL;
Column *coluna=NULL;
- Tabela *tabela=NULL;
+ Table *tabela=NULL;
QString elem, str_aux;
QStringList lista_aux;
vector<Reference> vet_refs;
@@ -5518,7 +5518,7 @@ View *ModeloBD::criarVisao(void)
if(!atributos[ParsersAttributes::TABLE].isEmpty())
{
coluna=NULL;
- tabela=dynamic_cast<Tabela *>(obterObjeto(atributos[ParsersAttributes::TABLE], OBJ_TABLE));
+ tabela=dynamic_cast<Table *>(obterObjeto(atributos[ParsersAttributes::TABLE], OBJ_TABLE));
//Dispara uma exceção caso a tabela referenciada não exista
if(!tabela)
@@ -5775,8 +5775,8 @@ BaseRelationship *ModeloBD::criarRelacionamento(void)
//Cria o novo relacionamento
relacao=new Relationship(tipo_relac,
- dynamic_cast<Tabela *>(tabelas[0]),
- dynamic_cast<Tabela *>(tabelas[1]),
+ dynamic_cast<Table *>(tabelas[0]),
+ dynamic_cast<Table *>(tabelas[1]),
obrig_orig, obrig_dest,
sufixo_auto, atributos[ParsersAttributes::SRC_SUFFIX],
atributos[ParsersAttributes::DST_SUFFIX],
@@ -5903,7 +5903,7 @@ Permission *ModeloBD::criarPermissao(void)
{
Permission *permissao=NULL;
BaseObject *objeto=NULL;
- Tabela *tabela_pai=NULL;
+ Table *tabela_pai=NULL;
Role *papel=NULL;
map<QString, QString> atrib_priv, atributos;
map<QString, QString>::iterator itr, itr_end;
@@ -5933,7 +5933,7 @@ Permission *ModeloBD::criarPermissao(void)
if(tipo_obj==OBJ_COLUMN)
{
//Primeiramente a tabela pai é obtida do modelo
- tabela_pai=dynamic_cast<Tabela *>(obterObjeto(obj_pai, OBJ_TABLE));
+ tabela_pai=dynamic_cast<Table *>(obterObjeto(obj_pai, OBJ_TABLE));
/* Caso a tabela pai existe obtém o objeto filho da mesma
o qual é referenciado pela permissão */
@@ -6091,7 +6091,7 @@ void ModeloBD::validarRemocaoColuna(Column *coluna)
}
}
-void ModeloBD::validarRelacObjetoTabela(TableObject *objeto, Tabela *tabela_pai)
+void ModeloBD::validarRelacObjetoTabela(TableObject *objeto, Table *tabela_pai)
{
try
{
@@ -6191,7 +6191,7 @@ QString ModeloBD::getCodeDefinition(unsigned tipo_def, bool exportar_arq)
map<unsigned, BaseObject *> mapa_objetos;
vector<unsigned> vet_id_objs, vet_id_objs_tab;
vector<Constraint *> vet_fks;
- Tabela *tabela=NULL;
+ Table *tabela=NULL;
Index *indice=NULL;
Trigger *gatilho=NULL;
Constraint *restricao=NULL;
@@ -6317,7 +6317,7 @@ QString ModeloBD::getCodeDefinition(unsigned tipo_def, bool exportar_arq)
while(itr!=itr_end)
{
- tabela=dynamic_cast<Tabela *>(*itr);
+ tabela=dynamic_cast<Table *>(*itr);
itr++;
//Varre a lista de restrições da tabela
@@ -6415,7 +6415,7 @@ QString ModeloBD::getCodeDefinition(unsigned tipo_def, bool exportar_arq)
//Stores the table's user added foreign keys
if(objeto->getObjectType()==OBJ_TABLE)
- dynamic_cast<Tabela *>(objeto)->obterChavesEstrangeiras(vet_fks);
+ dynamic_cast<Table *>(objeto)->obterChavesEstrangeiras(vet_fks);
if(objeto->getObjectType()==OBJ_RELATIONSHIP)
{
@@ -6897,7 +6897,7 @@ void ModeloBD::obterDependenciasObjeto(BaseObject *objeto, vector<BaseObject *>
//** Obtendo as dependências de Tabelas **
else if(tipo_obj==OBJ_TABLE)
{
- Tabela *tab=dynamic_cast<Tabela *>(objeto);
+ Table *tab=dynamic_cast<Table *>(objeto);
BaseObject *tipo_usr=NULL;
Constraint *rest=NULL;
Trigger *gat=NULL;
@@ -7034,10 +7034,10 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
if(tipo_obj==OBJ_TABLE)
{
- Tabela *tabela=dynamic_cast<Tabela *>(objeto);
+ Table *tabela=dynamic_cast<Table *>(objeto);
Sequence *seq=NULL;
Constraint *rest=NULL;
- Tabela *tab=NULL;
+ Table *tab=NULL;
Trigger *gat=NULL;
BaseRelationship *rel_base=NULL;
vector<BaseObject *>::iterator itr, itr_end;
@@ -7088,7 +7088,7 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
while(itr!=itr_end && (!modo_exclusao || (modo_exclusao && !refer)))
{
- tab=dynamic_cast<Tabela *>(*itr);
+ tab=dynamic_cast<Table *>(*itr);
//Verificando as restrições
qtd=tab->obterNumRestricoes();
@@ -7149,7 +7149,7 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
OBJ_AGGREGATE, OBJ_OPERATOR,
OBJ_TABLE, OBJ_TYPE, OBJ_LANGUAGE };
unsigned i, i1, qtd;
- Tabela *tab=NULL;
+ Table *tab=NULL;
Aggregate *func_ag=NULL;
Operator *oper=NULL;
Trigger *gat=NULL;
@@ -7229,7 +7229,7 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
while(itr!=itr_end && (!modo_exclusao || (modo_exclusao && !refer)))
{
//Obtém a referência ao objeto
- tab=dynamic_cast<Tabela *>(*itr);
+ tab=dynamic_cast<Table *>(*itr);
itr++;
qtd=tab->obterNumGatilhos();
for(i1=0; i1 < qtd && (!modo_exclusao || (modo_exclusao && !refer)); i1++)
@@ -7326,7 +7326,7 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
OBJ_OPERATOR, OBJ_TYPE };
unsigned i, i1, qtd;
OperatorClass *classe_op=NULL;
- Tabela *tab=NULL;
+ Table *tab=NULL;
Column *col=NULL;
Cast *conv_tipo=NULL;
Domain *dom=NULL;
@@ -7345,7 +7345,7 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
case OBJ_TYPE: ptr_tipopgsql=dynamic_cast<Type*>(objeto); break;
case OBJ_DOMAIN: ptr_tipopgsql=dynamic_cast<Domain*>(objeto); break;
case OBJ_SEQUENCE: ptr_tipopgsql=dynamic_cast<Sequence*>(objeto); break;
- default: ptr_tipopgsql=dynamic_cast<Tabela*>(objeto); break;
+ default: ptr_tipopgsql=dynamic_cast<Table*>(objeto); break;
}
/* Varre todas as listas de objetos os quais podem
@@ -7364,7 +7364,7 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
while(itr!=itr_end && (!modo_exclusao || (modo_exclusao && !refer)))
{
//Obtém a tabela
- tab=dynamic_cast<Tabela *>(*itr);
+ tab=dynamic_cast<Table *>(*itr);
itr++;
//Varre a lista de colunas da tabela
@@ -7608,7 +7608,7 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
{
vector<BaseObject *>::iterator itr, itr_end;
unsigned i, qtd;
- Tabela *tab=NULL;
+ Table *tab=NULL;
Index *ind=NULL;
Constraint *rest=NULL;
@@ -7620,7 +7620,7 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
while(itr!=itr_end && (!modo_exclusao || (modo_exclusao && !refer)))
{
//Obtém a tabela
- tab=dynamic_cast<Tabela *>(*itr);
+ tab=dynamic_cast<Table *>(*itr);
//Verifica se referencia o espaço de tabela
if(tab->getTablespace()==objeto)
@@ -7820,7 +7820,7 @@ void ModeloBD::obterReferenciasObjeto(BaseObject *objeto, vector<BaseObject *> &
}
else if(tipos_obj[i]==OBJ_TABLE)
{
- Tabela *tab=dynamic_cast<Tabela *>(*itr);
+ Table *tab=dynamic_cast<Table *>(*itr);
unsigned qtd_gat, qtd_rest, idx, qtd1, i1;
Trigger *gat=NULL;
View
20 libpgmodeler/src/modelobd.h
@@ -27,7 +27,7 @@
#include <QFile>
#include <QObject>
#include "baseobject.h"
-#include "tabela.h"
+#include "table.h"
#include "function.h"
#include "schema.h"
#include "view.h"
@@ -306,9 +306,9 @@ class ModeloBD: public QObject, public BaseObject {
View *obterVisao(unsigned idx_obj);
//Métodos de manipulação de tabela
- void adicionarTabela(Tabela *tabela, int idx_obj=-1);
- void removerTabela(Tabela *tabela, int idx_obj=-1);
- Tabela *obterTabela(unsigned idx_obj);
+ void adicionarTabela(Table *tabela, int idx_obj=-1);
+ void removerTabela(Table *tabela, int idx_obj=-1);
+ Table *obterTabela(unsigned idx_obj);
//Métodos de manipulação de tipos
void adicionarTipo(Type *tipo, int idx_obj=-1);
@@ -411,7 +411,7 @@ class ModeloBD: public QObject, public BaseObject {
OperatorFamily *criarFamiliaOperadores(void);
OperatorClass *criarClasseOperadores(void);
Aggregate *criarFuncaoAgregacao(void);
- Tabela *criarTabela(void);
+ Table *criarTabela(void);
Column *criarColuna(void);
Rule *criarRegra(void);
@@ -438,7 +438,7 @@ class ModeloBD: public QObject, public BaseObject {
através de chaves estrangeiras criadas pelo usuário. Caso já exista um relacionamento
entre duas tabelas mas o usuário crie uma segunda chave estrangeira com aplicação similiar
nenhum relacionamento será criado. */
- void atualizarRelFkTabela(Tabela *tabela);
+ void atualizarRelFkTabela(Table *tabela);
/* Cria uma restrição a partir do XML. Caso o parâmetro 'objeto' seja uma tabela
cria a restrição e já adiciona automaticaene primeira. Caso seja um relacionamento
@@ -454,15 +454,15 @@ class ModeloBD: public QObject, public BaseObject {
e uma chave primária está sendo recriada por este método e a tabela já possua um chave primária, isso
evita que seja disparado um erro indicando que a tabela já possui uma chave-primária. */
Constraint *criarRestricao(BaseObject *objeto);
- Index *criarIndice(Tabela *tabela);
- Trigger *criarGatilho(Tabela *tabela);
+ Index *criarIndice(Table *tabela);
+ Trigger *criarGatilho(Table *tabela);
/* Atualiza a referência dos tipos das colunas da tabela na lista
de tipos do PostgreSQL. Sempre que uma tabela é removida, inserida,
tem o nome alterado ou até mesmo tem o nome de uma coluna alterada,
é necessário chamar este método para que as referências seja devidamente
corrigidas ou removidas se necessário */
- void atualizarReferenciaTipoColunas(Tabela *tabela);
+ void atualizarReferenciaTipoColunas(Table *tabela);
/* Retorna se um dado objeto no modelo referência a coluna especificada.
Esse método deve ser usado antes da remoção da coluna. O não uso deste método
@@ -471,7 +471,7 @@ class ModeloBD: public QObject, public BaseObject {
void validarRemocaoColuna(Column *coluna);
//Valida os relacionamentos para refletirem as modificações nas coluna/restrição da tabela passada
- void validarRelacObjetoTabela(TableObject *objeto, Tabela *tabela_pai);
+ void validarRelacObjetoTabela(TableObject *objeto, Table *tabela_pai);
/* Retorna um erro caso um ciclo de relacionamentos for criado caso o relacionamento
passado seja inserido no modelo. Um ciclo de relacionamentos é proibido
View
18 libpgmodeler/src/operationlist.cpp
@@ -59,7 +59,7 @@ void copyObject(BaseObject **psrc_obj, BaseObject *copy_obj, ObjectType obj_type
copyObject(psrc_obj, dynamic_cast<Index *>(copy_obj));
break;
case OBJ_TABLE:
- copyObject(psrc_obj, dynamic_cast<Tabela *>(copy_obj));
+ copyObject(psrc_obj, dynamic_cast<Table *>(copy_obj));
break;
case OBJ_TEXTBOX:
copyObject(psrc_obj, dynamic_cast<Textbox *>(copy_obj));
@@ -264,7 +264,7 @@ void OperationList::removeOperations(void)
{
BaseObject *object=NULL;
TableObject *tab_obj=NULL;
- Tabela *tab=NULL;
+ Table *tab=NULL;
//Destroy the operations
while(!operations.empty())
@@ -289,7 +289,7 @@ void OperationList::removeOperations(void)
else if(tab_obj)
{
//Deletes the object if its not referenced by some table
- tab=dynamic_cast<Tabela *>(tab_obj->getParentTable());
+ tab=dynamic_cast<Table *>(tab_obj->getParentTable());
if(!tab || (tab && tab->obterIndiceObjeto(tab_obj)) < 0)
delete(tab_obj);
}
@@ -370,7 +370,7 @@ void OperationList::registerObject(BaseObject *object, unsigned op_type, int obj
{
ObjectType obj_type;
Operation *operation=NULL;
- Tabela *parent_tab=NULL;
+ Table *parent_tab=NULL;
Relationship *parent_rel=NULL;
int obj_idx=-1;
@@ -445,7 +445,7 @@ void OperationList::registerObject(BaseObject *object, unsigned op_type, int obj
tab_obj=dynamic_cast<TableObject *>(object);
if(parent_obj->getObjectType()==OBJ_TABLE)
- parent_tab=dynamic_cast<Tabela *>(parent_obj);
+ parent_tab=dynamic_cast<Table *>(parent_obj);
else
parent_rel=dynamic_cast<Relationship *>(parent_obj);
@@ -712,7 +712,7 @@ void OperationList::executeOperation(Operation *oper, bool redo)
{
BaseObject *orig_obj=NULL, *bkp_obj=NULL, *object=NULL, *aux_obj=NULL;
ObjectType obj_type;
- Tabela *parent_tab=NULL;
+ Table *parent_tab=NULL;
Relationship *parent_rel=NULL;
object=oper->pool_obj;
@@ -726,7 +726,7 @@ void OperationList::executeOperation(Operation *oper, bool redo)
if(oper->parent_obj)
{
if(oper->parent_obj->getObjectType()==OBJ_TABLE)
- parent_tab=dynamic_cast<Tabela *>(oper->parent_obj);
+ parent_tab=dynamic_cast<Table *>(oper->parent_obj);
else
parent_rel=dynamic_cast<Relationship *>(oper->parent_obj);
}
@@ -813,8 +813,8 @@ void OperationList::executeOperation(Operation *oper, bool redo)
else if(parent_rel)
parent_rel->addObject(dynamic_cast<TableObject *>(object), oper->object_idx);
else
- if(dynamic_cast<Tabela *>(object))
- dynamic_cast<Tabela *>(object)->getCodeDefinition(SchemaParser::SQL_DEFINITION);
+ if(dynamic_cast<Table *>(object))
+ dynamic_cast<Table *>(object)->getCodeDefinition(SchemaParser::SQL_DEFINITION);
model->adicionarObjeto(object, oper->object_idx);
}
/* If the operation is a previously created object or if the object
View
2 libpgmodeler/src/pgsqltypes.h
@@ -417,7 +417,7 @@ class PgSQLType: public BaseType{
friend class Type;
friend class Domain;
- friend class Tabela;
+ friend class Table;
friend class Sequence;
friend class ModeloBD;
};
View
4 libpgmodeler/src/reference.cpp
@@ -6,7 +6,7 @@ Reference::Reference(void)
this->column=NULL;
}
-Reference::Reference(Tabela *table, Column *column, const QString &tab_alias, const QString &col_alias)
+Reference::Reference(Table *table, Column *column, const QString &tab_alias, const QString &col_alias)
{
//Raises an error if the table is not allocated
if(!table)
@@ -42,7 +42,7 @@ Reference::Reference(const QString &expression, const QString &expr_alias)
this->expression=expression;
}
-Tabela *Reference::getTable(void)
+Table *Reference::getTable(void)
{
return(table);
}
View
8 libpgmodeler/src/reference.h
@@ -22,13 +22,13 @@
#ifndef REFERENCE_H
#define REFERENCE_H
-#include "tabela.h"
+#include "table.h"
#include "schema.h"
class Reference {
private:
//Stores the table used by the reference
- Tabela *table;
+ Table *table;
//Stores the column used by the reference
Column *column;
@@ -53,13 +53,13 @@ class Reference {
Reference(void);
//Creates a reference based on a table column
- Reference(Tabela *table, Column *column, const QString &tab_alias, const QString &col_alias);
+ Reference(Table *table, Column *column, const QString &tab_alias, const QString &col_alias);
//Creates a reference based on a expression
Reference(const QString &expression, const QString &expr_alias);
//Gets the referenced table
- Tabela *getTable(void);
+ Table *getTable(void);
//Gets the referenced column
Column *getColumn(void);
View
88 libpgmodeler/src/relationship.cpp
@@ -11,8 +11,8 @@ Relationship::Relationship(Relationship *rel) : BaseRelationship(rel)
(*(this))=(*rel);
}
-Relationship::Relationship(unsigned rel_type, Tabela *src_tab,
- Tabela *dst_tab, bool src_mdtry, bool dst_mdtry,
+Relationship::Relationship(unsigned rel_type, Table *src_tab,
+ Table *dst_tab, bool src_mdtry, bool dst_mdtry,
bool auto_suffix, const QString &src_suffix, const QString &dst_suffix,
bool identifier, bool deferrable, DeferralType deferral_type) :
BaseRelationship(rel_type, src_tab, dst_tab, src_mdtry, dst_mdtry)
@@ -603,7 +603,7 @@ unsigned Relationship::getObjectCount(ObjectType obj_type)
throw Exception(ERR_REF_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__);
}
-void Relationship::addConstraints(Tabela *dst_tab)
+void Relationship::addConstraints(Table *dst_tab)
{
Constraint *constr=NULL, *pk=NULL;
unsigned constr_id, constr_cnt, i, count;
@@ -677,7 +677,7 @@ void Relationship::addConstraints(Tabela *dst_tab)
void Relationship::addColumnsRelGen(void)
{
- Tabela *src_tab=NULL, *dst_tab=NULL,
+ Table *src_tab=NULL, *dst_tab=NULL,
*parent_tab=NULL, *aux_tab=NULL;
Column *src_col=NULL, *dst_col=NULL,
*column=NULL, *aux_col=NULL;
@@ -697,8 +697,8 @@ void Relationship::addColumnsRelGen(void)
try
{
- src_tab=dynamic_cast<Tabela *>(src_table);
- dst_tab=dynamic_cast<Tabela *>(dst_table);
+ src_tab=dynamic_cast<Table *>(src_table);
+ dst_tab=dynamic_cast<Table *>(dst_table);
//Gets the column count from participant tables
src_count=src_tab->obterNumColunas();
@@ -774,7 +774,7 @@ void Relationship::addColumnsRelGen(void)
//Checking if the column came from a inheritance or copy relationship
for(idx=0; idx < tab_count; idx++)
{
- parent_tab=dynamic_cast<Tabela *>(aux_tab->obterObjeto(idx, types[i2]));
+ parent_tab=dynamic_cast<Table *>(aux_tab->obterObjeto(idx, types[i2]));
cond=(parent_tab->obterColuna(aux_col->getName()));
if(id_tab==0)
@@ -915,15 +915,15 @@ void Relationship::connectRelationship(void)
addColumnsRelGen();
//The reference table is added as parent table on the receiver
- getReceiverTable()->adicionarTabelaPai(dynamic_cast<Tabela *>(getReferenceTable()));
+ getReceiverTable()->adicionarTabelaPai(dynamic_cast<Table *>(getReferenceTable()));
}
else if(rel_type==RELATIONSHIP_DEP)
{
//Creates the columns on the receiver table following the rules for copy rules
addColumnsRelGen();
//The reference table is added as copy table on the receiver
- getReceiverTable()->adicionarTabelaCopia(dynamic_cast<Tabela *>(getReferenceTable()));
+ getReceiverTable()->adicionarTabelaCopia(dynamic_cast<Table *>(getReferenceTable()));
}
else if(rel_type==RELATIONSHIP_11 ||
rel_type==RELATIONSHIP_1N)
@@ -937,7 +937,7 @@ void Relationship::connectRelationship(void)
{
if(!table_relnn)
//Allocates the table that represents the Many-to-Many relationship
- table_relnn=new Tabela;
+ table_relnn=new Table;
/* By default the schema and tablespace for the new table is the same as
the relationship source table */
@@ -963,7 +963,7 @@ void Relationship::connectRelationship(void)
}
}
-void Relationship::configureIndentifierRel(Tabela *dst_tab)
+void Relationship::configureIndentifierRel(Table *dst_tab)
{
Constraint *pk=NULL;
unsigned i, count;
@@ -1023,7 +1023,7 @@ void Relationship::configureIndentifierRel(Tabela *dst_tab)
}
}
-void Relationship::addUniqueKey(Tabela *ref_tab, Tabela *recv_tab)
+void Relationship::addUniqueKey(Table *ref_tab, Table *recv_tab)
{
Constraint *uq=NULL;
unsigned i, count;
@@ -1068,7 +1068,7 @@ void Relationship::addUniqueKey(Tabela *ref_tab, Tabela *recv_tab)
}
}
-void Relationship::addForeignKey(Tabela *ref_tab, Tabela *recv_tab, ActionType del_act, ActionType upd_act)
+void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del_act, ActionType upd_act)
{
Constraint *pk=NULL, *pk_aux=NULL, *fk=NULL;
unsigned i, i1, qty;
@@ -1128,11 +1128,11 @@ void Relationship::addForeignKey(Tabela *ref_tab, Tabela *recv_tab, ActionType d
//Case 1: decrementing the quantity of columns to be scanned
if((!isSelfRelationship() && ref_tab==src_table) ||
(isSelfRelationship() && table_relnn->obterNumRestricoes()==0))
- qty-=dynamic_cast<Tabela *>(dst_table)->obterChavePrimaria()->getColumnCount(Constraint::SOURCE_COLS);
+ qty-=dynamic_cast<Table *>(dst_table)->obterChavePrimaria()->getColumnCount(Constraint::SOURCE_COLS);
//Case 2: shifiting the scan index
else if(ref_tab==dst_table)
{
- pk_aux=dynamic_cast<Tabela *>(src_table)->obterChavePrimaria();
+ pk_aux=dynamic_cast<Table *>(src_table)->obterChavePrimaria();
i=pk_aux->getColumnCount(Constraint::SOURCE_COLS);
}
}
@@ -1169,7 +1169,7 @@ void Relationship::addForeignKey(Tabela *ref_tab, Tabela *recv_tab, ActionType d
}
}
-void Relationship::addAttributes(Tabela *recv_tab)
+void Relationship::addAttributes(Table *recv_tab)
{
unsigned i, count, i1;
Column *column=NULL;
@@ -1210,7 +1210,7 @@ void Relationship::addAttributes(Tabela *recv_tab)
}
}
-void Relationship::copyColumns(Tabela *ref_tab, Tabela *recv_tab, bool not_null)
+void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null)
{
Constraint *dst_pk=NULL, *src_pk=NULL, *pk=NULL;
unsigned i, count, i1;
@@ -1334,14 +1334,14 @@ void Relationship::copyColumns(Tabela *ref_tab, Tabela *recv_tab, bool not_null)
void Relationship::addColumnsRel11(void)
{
- Tabela *ref_tab=NULL, *recv_tab=NULL;
+ Table *ref_tab=NULL, *recv_tab=NULL;
try
{
ActionType del_action;
- ref_tab=dynamic_cast<Tabela *>(this->getReferenceTable());
- recv_tab=dynamic_cast<Tabela *>(this->getReceiverTable());
+ ref_tab=dynamic_cast<Table *>(this->getReferenceTable());
+ recv_tab=dynamic_cast<Table *>(this->getReceiverTable());
//Case the reference table is mandatory participation set as RESTRICT the delete action on the foreign key
if((ref_tab==this->src_table && this->isTableMandatory(SRC_TABLE)) ||
@@ -1399,14 +1399,14 @@ void Relationship::addColumnsRel11(void)
void Relationship::addColumnsRel1n(void)
{
- Tabela *ref_tab=NULL, *recv_tab=NULL;
+ Table *ref_tab=NULL, *recv_tab=NULL;
bool not_null=false;
ActionType del_action=ActionType::set_null, upd_action=ActionType::cascade;
try
{
- recv_tab=dynamic_cast<Tabela *>(this->getReceiverTable());
- ref_tab=dynamic_cast<Tabela *>(this->getReferenceTable());
+ recv_tab=dynamic_cast<Table *>(this->getReceiverTable());
+ ref_tab=dynamic_cast<Table *>(this->getReferenceTable());
/* Case the relationship isn't identifier and the source table is mandatory participation
the columns of the foreign key must not accept null values and the ON DELETE and ON UPDATE
@@ -1461,7 +1461,7 @@ void Relationship::addColumnsRel1n(void)
void Relationship::addColumnsRelNn(void)
{
- Tabela *tab=NULL, *tab1=NULL;
+ Table *tab=NULL, *tab1=NULL;
Constraint *pk_tabnn=NULL;
bool src_not_null=false, dst_not_null=false;
ActionType acao_del_orig=ActionType::restrict, acao_del_dest=ActionType::restrict,
@@ -1470,8 +1470,8 @@ void Relationship::addColumnsRelNn(void)
try
{
- tab=dynamic_cast<Tabela *>(src_table);
- tab1=dynamic_cast<Tabela *>(dst_table);
+ tab=dynamic_cast<Table *>(src_table);
+ tab1=dynamic_cast<Table *>(dst_table);
/* Copy the columns from the primary keys of the source and destination tables
to the table that represents the n-n relationship */
@@ -1502,7 +1502,7 @@ void Relationship::addColumnsRelNn(void)
}
}
-Tabela *Relationship::getReferenceTable(void)
+Table *Relationship::getReferenceTable(void)
{
/* Many to Many relationships doesn't has only one reference table so
is returned NULL */
@@ -1511,24 +1511,24 @@ Tabela *Relationship::getReferenceTable(void)
else
{
if(src_table==getReceiverTable())
- return(dynamic_cast<Tabela *>(dst_table));
+ return(dynamic_cast<Table *>(dst_table));
else
- return(dynamic_cast<Tabela *>(src_table));
+ return(dynamic_cast<Table *>(src_table));
}
}
-Tabela *Relationship::getReceiverTable(void)
+Table *Relationship::getReceiverTable(void)
{
if(rel_type==RELATIONSHIP_11)
{
/* Case 1: (0,1) ---<>--- (0,1)
Case 2: (1,1) ---<>--- (0,1) */
if((!src_mandatory && !dst_mandatory) ||
(src_mandatory && !dst_mandatory))
- return(dynamic_cast<Tabela *>(dst_table));
+ return(dynamic_cast<Table *>(dst_table));
/* Case 3: (0,1) ---<>--- (1,1) */
else if(!src_mandatory && dst_mandatory)
- return(dynamic_cast<Tabela *>(src_table));
+ return(dynamic_cast<Table *>(src_table));
// Case 4: (1,1) ---<>--- (1,1)
else
/* Returns NULL since this type of relationship isn't implemented. Refer to
@@ -1538,18 +1538,18 @@ Tabela *Relationship::getReceiverTable(void)
/* For 1-n relationships, the table order is unchagned this means that
the columns are always included in the destination table */
else if(rel_type==RELATIONSHIP_1N)
- return(dynamic_cast<Tabela *>(dst_table));
+ return(dynamic_cast<Table *>(dst_table));
/* For generalization / copy relationships the columns are always added
in the source table */
else if(rel_type==RELATIONSHIP_GEN ||
rel_type==RELATIONSHIP_DEP)
- return(dynamic_cast<Tabela *>(src_table));
+ return(dynamic_cast<Table *>(src_table));
//For n-n relationships, the columns are added in the table that represents the relationship (table_relnn)
else
- return(dynamic_cast<Tabela *>(table_relnn));
+ return(dynamic_cast<Table *>(table_relnn));
}
-void Relationship::removeTableObjectsRefCols(Tabela *table)
+void Relationship::removeTableObjectsRefCols(Table *table)
{
Trigger *trigger=NULL;
Index *index=NULL;
@@ -1601,7 +1601,7 @@ void Relationship::removeTableObjectsRefCols(Tabela *table)
}
}
-void Relationship::removeColumnsFromTablePK(Tabela *table)
+void Relationship::removeColumnsFromTablePK(Table *table)
{
if(table)
{
@@ -1642,7 +1642,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs)
{
vector<Column *>::iterator itr, itr_end;
Column *column=NULL;
- Tabela *table=NULL;
+ Table *table=NULL;
unsigned list_idx=0;
vector<TableObject *> *attr_list=NULL;
vector<TableObject *>::iterator itr_atrib, itr_atrib_end;
@@ -1676,7 +1676,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs)
/* Gets the table which has a foreign key that represents the
relationship (the table where the foreign key was inserted
upon connection of the relationship) */
- table=dynamic_cast<Tabela *>(fk_rel1n->getParentTable());
+ table=dynamic_cast<Table *>(fk_rel1n->getParentTable());
//Removes the foreign key from table
table->removerRestricao(fk_rel1n->getName());
@@ -1710,7 +1710,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs)
if(pk && pk==this->pk_relident)
{
//Gets the table that own the identifier relationship primary key
- table=dynamic_cast<Tabela *>(pk_relident->getParentTable());
+ table=dynamic_cast<Table *>(pk_relident->getParentTable());
//Removes the primary key from table
table->removerRestricao(pk_relident->getName());
@@ -1837,7 +1837,7 @@ bool Relationship::hasIndentifierAttribute(void)
bool Relationship::isInvalidated(void)
{
unsigned rel_cols_count, tab_cols_count, i, i1, count;
- Tabela *table=NULL, *table1=NULL;
+ Table *table=NULL, *table1=NULL;
Constraint *fk=NULL, *fk1=NULL, *constr=NULL, *pk=NULL;
bool valid=false;
Column *col1=NULL, *col2=NULL, *col3=NULL;
@@ -1851,7 +1851,7 @@ bool Relationship::isInvalidated(void)
any relationship 1-1, 1-n or n-n connected to it should be revalidated */
if(pk_relident && pk_relident->isAddedByLinking())
{
- dynamic_cast<Tabela *>(pk_relident->getParentTable())->removerObjeto(pk_relident);
+ dynamic_cast<Table *>(pk_relident->getParentTable())->removerObjeto(pk_relident);
pk_relident=NULL;
}
return(true);
@@ -1968,8 +1968,8 @@ bool Relationship::isInvalidated(void)
matches the column names of the originating tables */
else if(rel_type==RELATIONSHIP_NN)
{
- table=dynamic_cast<Tabela *>(src_table);
- table1=dynamic_cast<Tabela *>(dst_table);
+ table=dynamic_cast<Table *>(src_table);
+ table1=dynamic_cast<Table *>(dst_table);
/* To validated the n-n relationship, the first condition is that
both tables has primary key */
View
26 libpgmodeler/src/relationship.h
@@ -24,7 +24,7 @@
#define RELATIONSHIP_H
#include "baserelationship.h"
-#include "tabela.h"
+#include "table.h"
#include "textbox.h"
/*
@@ -177,7 +177,7 @@ class Relationship: public BaseRelationship {
*uq_rel11;
//Table created by the relationship n-n
- Tabela *table_relnn;
+ Table *table_relnn;
//Tables suffixes used to create unique names for the created columns
QString src_suffix, dst_suffix;
@@ -217,38 +217,38 @@ class Relationship: public BaseRelationship {
/* Creates the foreign key that represents the relationship and adds it
to the receiver table. Must be specified the actions ON DELETE and UPDATE. */
- void addForeignKey(Tabela *ref_tab, Tabela *recv_tab, ActionType del_act, ActionType upd_act);
+ void addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del_act, ActionType upd_act);
/* Creates the unique key that represents the 1-1 relationship e adds it to
the receiver table */
- void addUniqueKey(Tabela *ref_tab, Tabela *recv_tab);
+ void addUniqueKey(Table *ref_tab, Table *recv_tab);
//Adds the relationship attributes (columns) into receiver table
- void addAttributes(Tabela *recv_tab);
+ void addAttributes(Table *recv_tab);
/* Adds relationship constraints on the receiver table. If the relationship is
of type n-n, constraints will be added to the created table. If among the constraints
there is a primary key, then it will be merged with the primary key of receiver table */
- void addConstraints(Tabela *dst_tab);
+ void addConstraints(Table *dst_tab);
/* Executes adicional configurations on receiver table primary key when the
relationship is identifier */
- void configureIndentifierRel(Tabela *dst_tab);
+ void configureIndentifierRel(Table *dst_tab);
/* Copy the columns from the reference table to the receiver table. The parameter not_null indicates
that the columns must not accept null values */
- void copyColumns(Tabela *ref_tab, Tabela *recv_tab, bool not_null);
+ void copyColumns(Table *ref_tab, Table *recv_tab, bool not_null);
/* This method is always executed before disconnection of the relationship.
Its function is to remove from the specified table all the attributes which
references any relationship generated column avoiding reference break */
- void removeTableObjectsRefCols(Tabela *table);
+ void removeTableObjectsRefCols(Table *table);
//Creates the special primary key using the names stored in the 'column_ids_pk_rel' vector
void createSpecialPrimaryKey(void);
//Removes the columns created by the relationship from the specified table primary key if exists.
- void removeColumnsFromTablePK(Tabela *table);
+ void removeColumnsFromTablePK(Table *table);
protected:
//Destroy all the relationship attributes and constraints
@@ -261,7 +261,7 @@ class Relationship: public BaseRelationship {
Relationship(Relationship *rel);
Relationship(unsigned rel_type,
- Tabela *src_tab, Tabela *dst_tab,
+ Table *src_tab, Table *dst_tab,
bool src_mdtry=false, bool dst_mdtry=false,
bool auto_suffix=true,
const QString &src_suffix="", const QString &dst_suffix="",
@@ -406,7 +406,7 @@ class Relationship: public BaseRelationship {
WARNING: Not necessarily this method returns the destination table this because not in all
relationship configuration the receiver is the destination table */
- Tabela *getReceiverTable(void);
+ Table *getReceiverTable(void);
/* Returns table which serves as a reference when coping the columns to the
receiver table.
@@ -416,7 +416,7 @@ class Relationship: public BaseRelationship {
For n-n relationships this method returns NULL as this type of relationship
has 2 reference tables, which may be obtained by the method BaseRelationship::getTable() */
- Tabela *getReferenceTable(void);
+ Table *getReferenceTable(void);
//Returns SQL / XML definition for the relationship.
QString getCodeDefinition(unsigned def_type);
View
14 libpgmodeler/src/sequence.cpp
@@ -148,13 +148,13 @@ void Sequence::setName(const QString &name)
void Sequence::setSchema(BaseObject *schema)
{
- Tabela *table=NULL;
+ Table *table=NULL;
QString prev_name=this->getName(true);
if(owner_col)
{
//Gets the table that owns the column
- table=dynamic_cast<Tabela *>(owner_col->getParentTable());
+ table=dynamic_cast<Table *>(owner_col->getParentTable());
//Raises an error when the passed schema differs from the table schema
if(table && table->getSchema()!=schema)
@@ -203,7 +203,7 @@ void Sequence::setValues(QString minv, QString maxv, QString inc, QString start,
this->start=start;
}
-void Sequence::setOwnerColumn(Tabela *table, const QString &col_name)
+void Sequence::setOwnerColumn(Table *table, const QString &col_name)
{
if(!table || col_name=="")
this->owner_col=NULL;
@@ -240,13 +240,13 @@ void Sequence::setOwnerColumn(Tabela *table, const QString &col_name)
void Sequence::setOwnerColumn(Column *column)
{
- Tabela *tabela=NULL;
+ Table *tabela=NULL;
if(!column)
this->owner_col=NULL;
else
{
- tabela=dynamic_cast<Tabela *>(column->getParentTable());
+ tabela=dynamic_cast<Table *>(column->getParentTable());
//Raises an error when the column doesn't has a parent table
if(!tabela)
@@ -319,11 +319,11 @@ Column *Sequence::getOwnerColumn(void)
QString Sequence::getCodeDefinition(unsigned def_type)
{
QString str_aux;
- Tabela *table=NULL;
+ Table *table=NULL;
if(owner_col)
{
- table=dynamic_cast<Tabela *>(owner_col->getParentTable());
+ table=dynamic_cast<Table *>(owner_col->getParentTable());
str_aux=table->getName(true) + "." + owner_col->getName(true);
}
attributes[ParsersAttributes::OWNER_COLUMN]=str_aux;
View
4 libpgmodeler/src/sequence.h
@@ -23,7 +23,7 @@
#define SEQUENCE_H
#include "baseobject.h"
-#include "tabela.h"
+#include "table.h"
class Sequence: public BaseObject {
private:
@@ -74,7 +74,7 @@ class Sequence: public BaseObject {
void setValues(QString minv, QString maxv, QString inc, QString start, QString cache);
//Defines the owner column using a table and a column name
- void setOwnerColumn(Tabela *tabela, const QString &col_name);
+ void setOwnerColumn(Table *tabela, const QString &col_name);
//Defines the owner column using a column itself
void setOwnerColumn(Column *column);
View
176 libpgmodeler/src/tabela.cpp → libpgmodeler/src/table.cpp
@@ -1,6 +1,6 @@
-#include "tabela.h"
+#include "table.h"
-Tabela::Tabela(void) : BaseTable()
+Table::Table(void) : BaseTable()
{
obj_type=OBJ_TABLE;
attributes[ParsersAttributes::COLUMNS]="";
@@ -13,7 +13,7 @@ Tabela::Tabela(void) : BaseTable()
this->setName(trUtf8("new_table").toUtf8());
}
-Tabela::~Tabela(void)
+Table::~Table(void)
{
ObjectType tipos[]={ OBJ_TRIGGER, OBJ_INDEX, OBJ_RULE,
OBJ_CONSTRAINT, OBJ_COLUMN };
@@ -33,7 +33,7 @@ Tabela::~Tabela(void)
tabelas_pai.clear();
}
-void Tabela::setName(const QString &nome)
+void Table::setName(const QString &nome)
{
QString nome_ant=this->getName(true);
BaseObject::setName(nome);
@@ -43,7 +43,7 @@ void Tabela::setName(const QString &nome)
PgSQLType::renameUserType(nome_ant, this, this->getName(true));
}
-void Tabela::setSchema(BaseObject *esquema)
+void Table::setSchema(BaseObject *esquema)
{
QString nome_ant=this->getName(true);
@@ -55,12 +55,12 @@ void Tabela::setSchema(BaseObject *esquema)
PgSQLType::renameUserType(nome_ant, this, this->getName(true));
}
-void Tabela::definirAceitaOids(bool valor)
+void Table::definirAceitaOids(bool valor)
{
aceita_oids=valor;
}
-void Tabela::setProtected(bool protegido)
+void Table::setProtected(bool protegido)
{
ObjectType tipos_obj[]={ OBJ_COLUMN, OBJ_CONSTRAINT,
OBJ_INDEX, OBJ_RULE, OBJ_TRIGGER };
@@ -93,7 +93,7 @@ void Tabela::setProtected(bool protegido)
BaseGraphicObject::setProtected(protegido);
}
-void Tabela::definirAtributoComentario(TableObject *obj_tab)
+void Table::definirAtributoComentario(TableObject *obj_tab)
{
if(obj_tab && !obj_tab->getComment().isEmpty())
{
@@ -114,7 +114,7 @@ void Tabela::definirAtributoComentario(TableObject *obj_tab)
}
}
-void Tabela::definirAtributoColunas(unsigned tipo_def)
+void Table::definirAtributoColunas(unsigned tipo_def)
{
QString str_cols;
unsigned i, qtd;
@@ -159,7 +159,7 @@ void Tabela::definirAtributoColunas(unsigned tipo_def)
attributes[ParsersAttributes::COLUMNS]=str_cols;
}
-void Tabela::definirAtributoRestricoes(unsigned tipo_def)
+void Table::definirAtributoRestricoes(unsigned tipo_def)
{
QString str_rest;
unsigned i, qtd;
@@ -206,7 +206,7 @@ void Tabela::definirAtributoRestricoes(unsigned tipo_def)
attributes[ParsersAttributes::CONSTRAINTS]=str_rest;
}
-void Tabela::definirAtributoGatilhos(unsigned tipo_def)
+void Table::definirAtributoGatilhos(unsigned tipo_def)
{
QString str_gat;
unsigned i, qtd;
@@ -231,7 +231,7 @@ void Tabela::definirAtributoGatilhos(unsigned tipo_def)
attributes[ParsersAttributes::TRIGGERS]=str_gat;
}
-void Tabela::definirAtributoIndices(unsigned tipo_def)
+void Table::definirAtributoIndices(unsigned tipo_def)
{
QString str_ind;
unsigned i, qtd;
@@ -252,7 +252,7 @@ void Tabela::definirAtributoIndices(unsigned tipo_def)
attributes[ParsersAttributes::INDEXES]=str_ind;
}
-void Tabela::definirAtributoRegras(unsigned tipo_def)
+void Table::definirAtributoRegras(unsigned tipo_def)
{
QString str_reg;
unsigned i, qtd;
@@ -270,7 +270,7 @@ void Tabela::definirAtributoRegras(unsigned tipo_def)
attributes[ParsersAttributes::RULES]=str_reg;
}
-vector<TableObject *> *Tabela::obterListaObjetos(ObjectType tipo_obj)
+vector<TableObject *> *Table::obterListaObjetos(ObjectType tipo_obj)
{
//Retorna a referencia da lista equivalente ao tipo passado
if(tipo_obj==OBJ_COLUMN)
@@ -288,7 +288,7 @@ vector<TableObject *> *Tabela::obterListaObjetos(ObjectType tipo_obj)
throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__);
}
-void Tabela::adicionarObjeto(BaseObject *obj, int idx_obj, bool tab_copia)
+void Table::adicionarObjeto(BaseObject *obj, int idx_obj, bool tab_copia)
{
ObjectType tipo_obj;
@@ -408,17 +408,17 @@ void Tabela::adicionarObjeto(BaseObject *obj, int idx_obj, bool tab_copia)
break;
case OBJ_TABLE:
- Tabela *tab;
- tab=dynamic_cast<Tabela *>(obj);
+ Table *tab;
+ tab=dynamic_cast<Table *>(obj);
if(idx_obj < 0 || idx_obj >= static_cast<int>(tabelas_pai.size()))
tabelas_pai.push_back(tab);
else
tabelas_pai.insert((tabelas_pai.begin() + idx_obj), tab);
break;
case BASE_TABLE:
- Tabela *tab1;
- tab1=dynamic_cast<Tabela *>(obj);
+ Table *tab1;
+ tab1=dynamic_cast<Table *>(obj);
if(idx_obj < 0 || idx_obj >= static_cast<int>(tabelas_copia.size()))
tabelas_copia.push_back(tab1);
else
@@ -446,48 +446,48 @@ void Tabela::adicionarObjeto(BaseObject *obj, int idx_obj, bool tab_copia)
}
}
-void Tabela::adicionarColuna(Column *col, int idx_col)
+void Table::adicionarColuna(Column *col, int idx_col)
{
adicionarObjeto(col, idx_col);
}
-void Tabela::adicionarGatilho(Trigger *gat, int idx_gat)
+void Table::adicionarGatilho(Trigger *gat, int idx_gat)
{
adicionarObjeto(gat, idx_gat);
}
-void Tabela::adicionarIndice(Index *ind, int idx_ind)
+void Table::adicionarIndice(Index *ind, int idx_ind)
{
adicionarObjeto(ind, idx_ind);
}
-void Tabela::adicionarRegra(Rule *reg, int idx_reg)
+void Table::adicionarRegra(Rule *reg, int idx_reg)
{
adicionarObjeto(reg, idx_reg);
}
-void Tabela::adicionarRestricao(Constraint *constr, int idx_rest)
+void Table::adicionarRestricao(Constraint *constr, int idx_rest)
{
adicionarObjeto(constr, idx_rest);
}
-void Tabela::adicionarTabelaPai(Tabela *tab, int idx_tab)
+void Table::adicionarTabelaPai(Table *tab, int idx_tab)
{
adicionarObjeto(tab, idx_tab);
}
-void Tabela::adicionarTabelaCopia(Tabela *tab, int idx_tab)
+void Table::adicionarTabelaCopia(Table *tab, int idx_tab)
{
adicionarObjeto(tab, idx_tab, true);
}
-void Tabela::removerObjeto(BaseObject *objeto)
+void Table::removerObjeto(BaseObject *objeto)
{
if(objeto)
removerObjeto(objeto->getName(), objeto->getObjectType());
}
-void Tabela::removerObjeto(const QString &nome, ObjectType tipo_obj)
+void Table::removerObjeto(const QString &nome, ObjectType tipo_obj)
{
int idx;
@@ -500,7 +500,7 @@ void Tabela::removerObjeto(const QString &nome, ObjectType tipo_obj)
removerObjeto(static_cast<unsigned>(idx),tipo_obj);
}
-void Tabela::removerObjeto(unsigned idx_obj, ObjectType tipo_obj)
+void Table::removerObjeto(unsigned idx_obj, ObjectType tipo_obj)
{
/* Verfica se o tipo do objeto especifica está fora do conjunto dos que são
aceitos pela classe tabela */
@@ -514,15 +514,15 @@ void Tabela::removerObjeto(unsigned idx_obj, ObjectType tipo_obj)
//Caso o objeto a ser removido seja uma tabela pai e seu índice seja válido
else if(tipo_obj==OBJ_TABLE && idx_obj < tabelas_pai.size())
{
- vector<Tabela *>::iterator itr;
+ vector<Table *>::iterator itr;
itr=tabelas_pai.begin() + idx_obj; //Obtendo a referênci tabela pai
tabelas_pai.erase(itr); //Remove a tabela pai da lista
}
//Caso o objeto a ser removido seja uma tabela cópia e seu índice seja válido
else if(tipo_obj==BASE_TABLE && idx_obj < tabelas_copia.size())
{
- vector<Tabela *>::iterator itr;
+ vector<Table *>::iterator itr;
itr=tabelas_copia.begin() + idx_obj; //Obtendo a referênci tabela copia
tabelas_copia.erase(itr); //Remove a tabela pai da lista
@@ -576,98 +576,98 @@ void Tabela::removerObjeto(unsigned idx_obj, ObjectType tipo_obj)
}
}
-void Tabela::removerColuna(const QString &nome)
+void Table::removerColuna(const QString &nome)
{
removerObjeto(nome,OBJ_COLUMN);
}
-void Tabela::removerColuna(unsigned idx_col)
+void Table::removerColuna(unsigned idx_col)
{
removerObjeto(idx_col,OBJ_COLUMN);
}
-void Tabela::removerGatilho(const QString &nome)
+void Table::removerGatilho(const QString &nome)
{
removerObjeto(nome,OBJ_TRIGGER);
}
-void Tabela::removerGatilho(unsigned idx_gat)
+void Table::removerGatilho(unsigned idx_gat)
{
removerObjeto(idx_gat,OBJ_TRIGGER);
}
-void Tabela::removerIndice(const QString &nome)
+void Table::removerIndice(const QString &nome)
{
removerObjeto(nome,OBJ_INDEX);
}
-void Tabela::removerIndice(unsigned idx_ind)
+void Table::removerIndice(unsigned idx_ind)
{
removerObjeto(idx_ind,OBJ_INDEX);
}
-void Tabela::removerRegra(const QString &nome)
+void Table::removerRegra(const QString &nome)
{
removerObjeto(nome,OBJ_RULE);
}
-void Tabela::removerRegra(unsigned idx_reg)
+void Table::removerRegra(unsigned idx_reg)
{
removerObjeto(idx_reg,OBJ_RULE);
}
-void Tabela::removerRestricao(const QString &nome)
+void Table::removerRestricao(const QString &nome)
{
removerObjeto(nome,OBJ_CONSTRAINT);
}
-void Tabela::removerRestricao(unsigned idx_const)
+void Table::removerRestricao(unsigned idx_const)
{
removerObjeto(idx_const,OBJ_CONSTRAINT);
}
-void Tabela::removerTabelaPai(const QString &nome)
+void Table::removerTabelaPai(const QString &nome)
{
removerObjeto(nome,OBJ_TABLE);
}
-void Tabela::removerTabelaPai(unsigned idx_tab)
+void Table::removerTabelaPai(unsigned idx_tab)
{
removerObjeto(idx_tab,OBJ_TABLE);
}
-void Tabela::removerTabelaCopia(const QString &nome)
+void Table::removerTabelaCopia(const QString &nome)
{
removerObjeto(nome,BASE_TABLE);
}
-void Tabela::removerTabelaCopia(unsigned idx_tab)
+void Table::removerTabelaCopia(unsigned idx_tab)
{
removerObjeto(idx_tab,BASE_TABLE);
}
-int Tabela::obterIndiceObjeto(const QString &nome, ObjectType tipo_obj)
+int Table::obterIndiceObjeto(const QString &nome, ObjectType tipo_obj)
{
int idx;
obterObjeto(nome, tipo_obj, idx);
return(idx);
}
-int Tabela::obterIndiceObjeto(TableObject *objeto)
+int Table::obterIndiceObjeto(TableObject *objeto)
{
if(!objeto)
return(-1);
else
return(obterIndiceObjeto(objeto->getName(true), objeto->getObjectType()));
}
-BaseObject *Tabela::obterObjeto(const QString &nome, ObjectType tipo_obj)
+BaseObject *Table::obterObjeto(const QString &nome, ObjectType tipo_obj)
{
int idx;
return(obterObjeto(nome, tipo_obj, idx));
}
-BaseObject *Tabela::obterObjeto(const QString &nome, ObjectType tipo_obj, int &idx_obj)
+BaseObject *Table::obterObjeto(const QString &nome, ObjectType tipo_obj, int &idx_obj)
{
BaseObject *objeto=NULL;
bool enc=false, formatar=false;
@@ -717,8 +717,8 @@ BaseObject *Tabela::obterObjeto(const QString &nome, ObjectType tipo_obj, int &i
//Caso o objeto a ser obtido seja uma tabela pai
else if(tipo_obj==OBJ_TABLE || tipo_obj==BASE_TABLE)
{
- vector<Tabela *>::iterator itr_tab, itr_end_tab;
- vector<Tabela *> *tabelas;
+ vector<Table *>::iterator itr_tab, itr_end_tab;
+ vector<Table *> *tabelas;
QString nome_aux;
//Obrigatoriamente todo nome de tabela deve ser formatado por conta do esquema
@@ -762,7 +762,7 @@ BaseObject *Tabela::obterObjeto(const QString &nome, ObjectType tipo_obj, int &i
return(objeto);
}
-BaseObject *Tabela::obterObjeto(unsigned idx_obj, ObjectType tipo_obj)
+BaseObject *Table::obterObjeto(unsigned idx_obj, ObjectType tipo_obj)
{
vector<TableObject *> *lista_obj=NULL;
@@ -796,18 +796,18 @@ BaseObject *Tabela::obterObjeto(unsigned idx_obj, ObjectType tipo_obj)
}
}
-Tabela *Tabela::obterTabelaPai(const QString &nome)
+Table *Table::obterTabelaPai(const QString &nome)
{
int idx;
- return(dynamic_cast<Tabela *>(obterObjeto(nome,OBJ_TABLE,idx)));
+ return(dynamic_cast<Table *>(obterObjeto(nome,OBJ_TABLE,idx)));
}
-Tabela *Tabela::obterTabelaPai(unsigned idx_tab)
+Table *Table::obterTabelaPai(unsigned idx_tab)
{
- return(dynamic_cast<Tabela *>(obterObjeto(idx_tab,OBJ_TABLE)));
+ return(dynamic_cast<Table *>(obterObjeto(idx_tab,OBJ_TABLE)));
}
-Column *Tabela::obterColuna(const QString &nome, bool ref_nome_antigo)
+Column *Table::obterColuna(const QString &nome, bool ref_nome_antigo)
{
if(!ref_nome_antigo)
{
@@ -840,102 +840,102 @@ Column *Tabela::obterColuna(const QString &nome, bool ref_nome_antigo)
}
}
-Column *Tabela::obterColuna(unsigned idx_col)
+Column *Table::obterColuna(unsigned idx_col)
{
return(dynamic_cast<Column *>(obterObjeto(idx_col,OBJ_COLUMN)));
}
-Trigger *Tabela::obterGatilho(const QString &nome)
+Trigger *Table::obterGatilho(const QString &nome)
{
int idx;
return(dynamic_cast<Trigger *>(obterObjeto(nome,OBJ_TRIGGER,idx)));
}
-Trigger *Tabela::obterGatilho(unsigned idx_gat)
+Trigger *Table::obterGatilho(unsigned idx_gat)
{
return(dynamic_cast<Trigger *>(obterObjeto(idx_gat,OBJ_TRIGGER)));
}
-Constraint *Tabela::obterRestricao(const QString &nome)
+Constraint *Table::obterRestricao(const QString &nome)
{
int idx;
return(dynamic_cast<Constraint *>(obterObjeto(nome,OBJ_CONSTRAINT,idx)));
}
-Constraint *Tabela::obterRestricao(unsigned idx_constr)
+Constraint *Table::obterRestricao(unsigned idx_constr)
{
return(dynamic_cast<Constraint *>(obterObjeto(idx_constr,OBJ_CONSTRAINT)));
}
-Index *Tabela::obterIndice(const QString &nome)
+Index *Table::obterIndice(const QString &nome)
{
int idx;
return(dynamic_cast<Index *>(obterObjeto(nome,OBJ_INDEX,idx)));
}
-Index *Tabela::obterIndice(unsigned idx_ind)
+Index *Table::obterIndice(unsigned idx_ind)
{
return(dynamic_cast<Index *>(obterObjeto(idx_ind,OBJ_INDEX)));
}
-Rule *Tabela::obterRegra(const QString &nome)
+Rule *Table::obterRegra(const QString &nome)
{
int idx;
return(dynamic_cast<Rule *>(obterObjeto(nome,OBJ_RULE,idx)));
}
-Rule *Tabela::obterRegra(unsigned idx_reg)
+Rule *Table::obterRegra(unsigned idx_reg)
{
return(dynamic_cast<Rule *>(obterObjeto(idx_reg,OBJ_RULE)));
}
-Tabela *Tabela::obterTabelaCopia(const QString &nome)
+Table *Table::obterTabelaCopia(const QString &nome)
{
int idx;
- return(dynamic_cast<Tabela *>(obterObjeto(nome,BASE_TABLE,idx)));
+ return(dynamic_cast<Table *>(obterObjeto(nome,BASE_TABLE,idx)));
}
-Tabela *Tabela::obterTabelaCopia(unsigned idx_tab)
+Table *Table::obterTabelaCopia(unsigned idx_tab)
{
- return(dynamic_cast<Tabela *>(obterObjeto(idx_tab,BASE_TABLE)));
+ return(dynamic_cast<Table *>(obterObjeto(idx_tab,BASE_TABLE)));
}
-unsigned Tabela::obterNumColunas(void)
+unsigned Table::obterNumColunas(void)
{
return(colunas.size());
}
-unsigned Tabela::obterNumGatilhos(void)
+unsigned Table::obterNumGatilhos(void)
{
return(gatilhos.size());
}
-unsigned Tabela::obterNumRestricoes(void)
+unsigned Table::obterNumRestricoes(void)
{
return(restricoes.size());
}
-unsigned Tabela::obterNumIndices(void)
+unsigned Table::obterNumIndices(void)
{
return(indices.size());
}
-unsigned Tabela::obterNumRegras(void)
+unsigned Table::obterNumRegras(void)
{
return(regras.size());
}
-unsigned Tabela::obterNumTabelasPai(void)
+unsigned Table::obterNumTabelasPai(void)
{
return(tabelas_pai.size());
}
-unsigned Tabela::obterNumTabelasCopia(void)
+unsigned Table::obterNumTabelasCopia(void)
{
return(tabelas_copia.size());
}
-unsigned Tabela::obterNumObjetos(ObjectType tipo_obj, bool inc_insporrelacao)
+unsigned Table::obterNumObjetos(ObjectType tipo_obj, bool inc_insporrelacao)
{
if(tipo_obj==OBJ_COLUMN || tipo_obj==OBJ_CONSTRAINT ||
tipo_obj==OBJ_TRIGGER ||/* tipo_obj==OBJETO_GAT_RESTRICAO ||*/
@@ -978,7 +978,7 @@ unsigned Tabela::obterNumObjetos(ObjectType tipo_obj, bool inc_insporrelacao)
throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__);
}
-Constraint *Tabela::obterChavePrimaria(void)
+Constraint *Table::obterChavePrimaria(void)
{
unsigned qtd,i;
Constraint *pk=NULL, *rest=NULL;
@@ -993,7 +993,7 @@ Constraint *Tabela::obterChavePrimaria(void)
return(pk);
}
-void Tabela::obterChavesEstrangeiras(vector<Constraint *> &vet_fks, bool inc_insporrelacao)
+void Table::obterChavesEstrangeiras(vector<Constraint *> &vet_fks, bool inc_insporrelacao)
{
unsigned qtd,i;
Constraint *constr=NULL;
@@ -1013,12 +1013,12 @@ void Tabela::obterChavesEstrangeiras(vector<Constraint *> &vet_fks, bool inc_ins
}
}
-bool Tabela::aceitaOids(void)
+bool Table::aceitaOids(void)
{
return(aceita_oids);
}
-bool Tabela::referenciaTabelaChaveEstrangeira(Tabela *tab_ref)
+bool Table::referenciaTabelaChaveEstrangeira(Table *tab_ref)
{
unsigned qtd,i;
Constraint *constr=NULL;
@@ -1036,7 +1036,7 @@ bool Tabela::referenciaTabelaChaveEstrangeira(Tabela *tab_ref)
return(found);
}
-bool Tabela::restricaoReferenciaColuna(Column *coluna, ConstraintType tipo_rest)
+bool Table::restricaoReferenciaColuna(Column *coluna, ConstraintType tipo_rest)
{
bool enc=false;
vector<TableObject *>::iterator itr, itr_end;
@@ -1059,7 +1059,7 @@ bool Tabela::restricaoReferenciaColuna(Column *coluna, ConstraintType tipo_rest)
return(enc);
}
-QString Tabela::getCodeDefinition(unsigned tipo_def)
+QString Table::getCodeDefinition(unsigned tipo_def)
{
attributes[ParsersAttributes::OIDS]=(aceita_oids ? "1" : "");
definirAtributoColunas(tipo_def);
@@ -1074,7 +1074,7 @@ QString Tabela::getCodeDefinition(unsigned tipo_def)
return(BaseObject::__getCodeDefinition(tipo_def));
}
-void Tabela::operator = (Tabela &tabela)
+void Table::operator = (Table &tabela)
{
QString nome_ant = this->getName(true);
@@ -1085,7 +1085,7 @@ void Tabela::operator = (Tabela &tabela)
PgSQLType::renameUserType(nome_ant, this, this->getName(true));
}
-bool Tabela::referenciaObjetoIncRelacao(void)
+bool Table::referenciaObjetoIncRelacao(void)
{
vector<TableObject *>::iterator itr, itr_end;
ObjectType tipos[]={ OBJ_COLUMN, OBJ_CONSTRAINT };
@@ -1114,7 +1114,7 @@ bool Tabela::referenciaObjetoIncRelacao(void)
return(enc);
}
-void Tabela::trocarIndicesObjetos(ObjectType tipo_obj, unsigned idx1, unsigned idx2)
+void Table::trocarIndicesObjetos(ObjectType tipo_obj, unsigned idx1, unsigned idx2)
{
vector<TableObject *> *lista_obj=NULL;
vector<TableObject *>::iterator itr1, itr2;
@@ -1143,7 +1143,7 @@ void Tabela::trocarIndicesObjetos(ObjectType tipo_obj, unsigned idx1, unsigned i
}
}
-void Tabela::obterReferenciasColuna(Column *coluna, vector<TableObject *> &vet_refs, bool modo_exclusao)
+void Table::obterReferenciasColuna(Column *coluna, vector<TableObject *> &vet_refs, bool modo_exclusao)
{
/* Caso a coluna não foi incluída por relacionamento, será verificado se esta
não está sendo referenciada. Para colunas adicionadas automaticamente por
View
30