Lançado Adianti Framework 7.6!
Clique aqui para saber mais
Erro de chave estrangeira em Composição Senhores, boa noite, estou com um problema para resolver com relação a uma chave estrangeira! A classe principal é a Solução que é composta pelas classes Soro e Hormônio. Ao tentar gravar no banco de dados as informações digitadas pelo usuário, está ocorrendo erro de chave estrangeira, conforme é mostrado na imagem em anexo. As classes estão aqui abaixo: Formulario que recebe o...
TS
Erro de chave estrangeira em Composição  
Fechado
Senhores, boa noite, estou com um problema para resolver com relação a uma chave estrangeira!

A classe principal é a Solução que é composta pelas classes Soro e Hormônio. Ao tentar gravar no banco de dados as informações digitadas pelo usuário, está ocorrendo erro de chave estrangeira, conforme é mostrado na imagem em anexo. As classes estão aqui abaixo:
Formulario que recebe os dados
  1. <?php
  2. class FrmSolucao extends TPage
  3. {
  4.     private $form;
  5.     private $datagrid_primeira_aplicacao;
  6.     private $datagrid_segunda_aplicacao;
  7.     function __construct()
  8.     {
  9.     
  10.         parent::__construct();
  11.         
  12.         //$this->form = new TQuickForm('form_Solucao');
  13.         $this->form = new TQuickForm('form_solucao');
  14.         $this->form->class 'tform'// change CSS class
  15.         $this->form->style 'display: table;width:70%; margin-left:50px;'// change style
  16.         //$this->form->setFormTitle('Aplicação de hormônios');
  17.         $notebook  = new BootstrapNotebookWrapper(new TNotebook(300350));
  18.        
  19.         $this->form->add($notebook);
  20.         
  21.           parent::include_css('app/resources/custom-notebook.css');
  22.         
  23.         // creates the containers for each notebook page
  24.         $tbl_solucao = new TTable;
  25.         $tbl_hormonio = new TTable;
  26.         $tbl_soro = new TTable;
  27.         $tbl_pAplicacao = new TTable;
  28.         $tbl_sAplicacao = new TTable;
  29.         $tbl_solucao->style "margin: 2px;width:100%;";
  30.         $tbl_pAplicacao->style "margin: 4px";
  31.         $tbl_sAplicacao->style "margin: 4px";
  32.         $tbl_hormonio->style "margin: 4px";
  33.         $tbl_soro->style "margin: 4px";
  34.                 
  35.         ####Campos primeira página######
  36.         
  37.         2427Solucao     = new THidden('idSolucao');
  38.         $cmbReproducao = new  ">TDBSeekButton('idReproducao','dbwf',$this->form->getName(),'Reproducao','codigo','idReproducao','cod_reproducao');
  39.         $cod_reproducao = new TEntry('cod_reproducao');
  40.         $pVolTotalAplicado = new TEntry('pVolTotalAplicado');
  41.         $pVolTotalAplicado->setTip('Volume total de solução a ser aplicado na primeira aplicação em mg');
  42.         $sVolTotalAplicado = new TEntry('sVolTotalAplicado');
  43.         $sVolTotalAplicado->setTip('Volume total de solução a ser aplicado na segunda aplicação em mg');
  44.         
  45.         //validações
  46.         $cod_reproducao->setExitAction(new TAction(array($this,'onSelect')));
  47.         
  48.         
  49.          ####Adicionando os campos na aba do notebook####                
  50.         $tbl_solucao->addRowSet(new TLabel(''),2427Solucao);
  51.         $tbl_solucao->addRowSet(new TLabel('REPRODUÇÃO..:'),$cmbReproducao);
  52.         $tbl_solucao->addRowSet(new TLabel('Nº..........:'),$cod_reproducao);
  53.         $tbl_solucao->addRowSet(new TLabel('VOL. TOTAL 1ª APLICAÇÃO..:'),$pVolTotalAplicado);
  54.         $tbl_solucao->addRowSet(new TLabel('VOL. TOTAL 2ª APLICAÇÃO..:'),$sVolTotalAplicado);
  55.         
  56.         
  57.         
  58.         #####Campos segunda Pagina#####
  59.         $lista_soro = new TMultiField('lista_soro');
  60.         $nome_soro = new TEntry('nomeSoro');
  61.         $desc_soro = new TEntry('descSoro');
  62.         $valor_soro = new TEntry('valorSoro');
  63.         $qtdeSoroAplicKvP = new TEntry('qtdeSoroAplicKvP');
  64.         $totalSoroAplicacao = new TEntry('totalSoroAplicacao');
  65.         
  66.         ####Adicionando os campos na aba do notebook####  
  67.         
  68.         $row $tbl_soro->addRow();
  69.         $cell $row->addCell(new TLabel('<b><h4>..::SORO::..</h4></b>'));
  70.         $cell->valign  'top';
  71.         $lista_soro->setHeight(150);
  72.         $lista_soro->setClass('Soro');
  73.         $lista_soro->addField('nomeSoro','NOME'.':',$nome_soro,150);
  74.         $lista_soro->addField('descSoro','DESCRIÇÃO'.':',$desc_soro,150);
  75.         $lista_soro->addField('valorSoro','VALOR EM R$'.':',$valor_soro,70);
  76.         $lista_soro->addField('qtdeSoroAplicKvP','TOTAL A SER APLICADO'.':',$qtdeSoroAplicKvP,70);
  77.         $lista_soro->addField('totalSoroAplicacao','TOTAL SORO EM R$'.':',$totalSoroAplicacao,70);
  78.         $row=$tbl_soro->addRow();
  79.         $row->addCell($lista_soro);
  80.         
  81.         #####Campos terceira Página#######
  82.         $lista_hormonio = new TMultiField('lista_hormonio');
  83.         $nome_hormonio = new TEntry('nomeHormonio');
  84.         $desc_hormonio = new TEntry('descHormonio');
  85.         $valor_hormonio = new TEntry('valorHormonio');
  86.         $qtdeHormonioAplicKvP = new TEntry('qtdeHormonioAplicKvP');
  87.         $totalHormonioAplicacao = new TEntry('totalHormonioAplicacao');
  88.         
  89.         ####Adicionando os campos na aba do notebook####  
  90.         
  91.         $row $tbl_hormonio->addRow();
  92.         $cell $row->addCell(new TLabel('<b><h4>..::HORMÔNIO::..</h4></b>'));
  93.         $cell->valign  'top';
  94.         $lista_hormonio->setHeight(150);
  95.         $lista_hormonio->setClass('Hormonio');
  96.         $lista_hormonio->addField('nomeHormonio','NOME'.':',$nome_hormonio,150);
  97.         $lista_hormonio->addField('descHormonio','DESCRIÇÃO'.':',$desc_hormonio,150);
  98.         $lista_hormonio->addField('valorHormonio','VALOR EM R$'.':',$valor_hormonio,70);
  99.         $lista_hormonio->addField('qtdeHormonioAplicKvP','TOTAL A SER APLICADO'.':',$qtdeHormonioAplicKvP,70);
  100.         $lista_hormonio->addField('totalHormonioAplicacao','TOTAL HORMÔNIO EM R$'.':',$totalHormonioAplicacao,70);
  101.         $row=$tbl_hormonio->addRow();
  102.         $row->addCell($lista_hormonio);
  103.         
  104.         #####Campos quarta Página#####
  105.         //$row = $tbl_pAplicacao->addRow();
  106.         $this->datagrid_primeira_aplicacao = new TQuickGrid;
  107.         $this->datagrid_primeira_aplicacao->disableDefaultClick();
  108.         
  109.         $this->datagrid_primeira_aplicacao->addQuickColumn('Número',  'numero',    'center'70);
  110.         $this->datagrid_primeira_aplicacao->addQuickColumn('Identificação',    'identMatriz',    'right'180);
  111.         $this->datagrid_primeira_aplicacao->addQuickColumn('Peso''pesoMatriz''center'180);
  112.         $this->datagrid_primeira_aplicacao->addQuickColumn('Volume a Injetar',   'fone',    'left'120);      
  113.         $this->datagrid_primeira_aplicacao->createModel();
  114.         $row1 $tbl_pAplicacao->addRow();
  115.         $row1->addCell($this->datagrid_primeira_aplicacao);
  116.         //$row->addCell($tbl_pAplicacao);
  117.         
  118.         #####Campos Quinta Página#####
  119.          $this->datagrid_segunda_aplicacao = new TQuickGrid;
  120.         $this->datagrid_segunda_aplicacao->disableDefaultClick();
  121.         
  122.         $this->datagrid_segunda_aplicacao->addQuickColumn('Code',    'code',    'right'70);
  123.         $this->datagrid_segunda_aplicacao->addQuickColumn('Name',    'name',    'left'180);
  124.         $this->datagrid_segunda_aplicacao->addQuickColumn('Address''address''left'180);
  125.         $this->datagrid_segunda_aplicacao->addQuickColumn('Phone',   'fone',    'left'120);      
  126.         $this->datagrid_segunda_aplicacao->createModel();
  127.         $row2 $tbl_sAplicacao->addRow();
  128.         $row2->addCell($this->datagrid_segunda_aplicacao);
  129.         
  130.         
  131.         
  132.         //$this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'fa:floppy-o');
  133.         //$this->form->addQuickAction(_t('New'),  new TAction(array($this, 'onClear')), 'bs:plus-sign green');
  134.         $notebook->appendPage('Totais Solução'$tbl_solucao);
  135.         $notebook->appendPage('Soro'$tbl_soro);
  136.         $notebook->appendPage('Hormônio'$tbl_hormonio);
  137.         $notebook->appendPage('1ª Aplicação'$tbl_pAplicacao);
  138.         $notebook->appendPage('2ª Aplicação'$tbl_sAplicacao);
  139.         
  140.         $save_button=new TButton('save');
  141.         $save_button->setAction(new TAction(array($this'onSave')), _t('Save'));
  142.         $save_button->setImage('fa:floppy-o');
  143.         
  144.         // create an new button (edit with no parameters)
  145.         $new_button=new TButton('new');
  146.         $new_button->setAction(new TAction(array($this'onEdit')), _t('New'));
  147.         $new_button->setImage('fa:plus-square green');
  148.         
  149.         $list_button=new TButton('list');
  150.         $list_button->setAction(new TAction(array('FrmListaReproducao','onReload')), _t('Back to the listing'));
  151.         $list_button->setImage('fa:table blue');
  152.         
  153.         $this->form->setFields(array(2427Solucao$cmbReproducao$cod_reproducao$pVolTotalAplicado$sVolTotalAplicado$lista_soro$save_button$new_button$list_button));
  154.         
  155.        
  156.         
  157.         $buttons = new THBox;
  158.         $buttons->add($save_button);
  159.         $buttons->add($new_button);
  160.         $buttons->add($list_button);
  161.         
  162.         //$this->form->add($buttons);
  163.         // vertical box container
  164.         $container = new TVBox;
  165.         $container->style 'width: 60%;  margin-left:5%;';
  166.         // $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
  167.         $container->add(TPanelGroup::pack('Aplicação de Hormônios',$this->form));
  168.         $container->add($buttons);
  169.         
  170.         parent::add($container);   
  171.         
  172.    }
  173.    
  174.    public function onSave()
  175.    {
  176.    
  177.        try
  178.        {
  179.            TTransaction::open('dbwf');
  180.                $this->form->validate(); // validate form data
  181.                $object =$this->form->getData('Solucao');  // create an empty object
  182.                2427Reproducao $object->idSolucao;
  183.                $data $this->form->getData(); // get form data as array
  184.                $object->fromArray( (array) $data); // load the object with data
  185.                $object->pVolTotalAplicado str_replace(',','.'$object->pVolTotalAplicado);
  186.                $object->sVolTotalAplicado str_replace(',','.'$object->sVolTotalAplicado);
  187.                if($object->lista_soro)
  188.                {
  189.                    foreach($object->lista_soro as $soro)
  190.                    {
  191.                    
  192.                        $object->addSoro($soro);
  193.                    
  194.                    }
  195.                }
  196.                if($object->lista_hormonio)
  197.                {
  198.                
  199.                    foreach($object->lista_hormonio as $hormonio)
  200.                    {
  201.                        $object->addHormonio($hormonio);
  202.                    }
  203.                }
  204.                $object->store(); // save the object
  205.                 
  206.                 // get the generated idSolucao
  207.                $data->idSolucao $object->idSolucao;
  208.                 
  209.                $this->form->setData($data); // fill form data
  210.            TTransaction::close(); // close the transaction
  211.              new TMessage('info','Registro Gravado com sucesso!');
  212.            
  213.        }
  214.        catch(Exception $e)
  215.        {
  216.             new TMessage('Erro ao gravar o registro!'$e->getMessage()); // shows the exception error message
  217.             $this->form->setData$this->form->getData() ); // keep form data
  218.             TTransaction::rollback(); //
  219.        }
  220.    }
  221.    public function onReload()
  222.    {
  223.        $this->datagrid_primeira_aplicacao->clear();
  224.        
  225.        try
  226.        {
  227.            
  228.        }
  229.        catch(Exception $e)
  230.        {
  231.            // shows the exception error message
  232.             new TMessage('Erro ao carregar os registros'$e->getMessage());
  233.             // undo all pending operations
  234.             TTransaction::rollback();  
  235.        }
  236.    }
  237.    public function onEdit()
  238.    {
  239.    
  240.    }
  241.    public static function onSelect($params)
  242.    {
  243.          $DSPV 0.5;
  244.          $DDPV 5.0;
  245.         if(isset($params['cod_reproducao'])&& $params['cod_reproducao'])
  246.         {
  247.             try
  248.             {
  249.                 TTransaction::open('dbwf');
  250.                     $rep = new Reproducao($params['idReproducao']);
  251.                     $obj = new StdClass;
  252.                     $obj->pVolTotalAplicado number_format(($DSPV $rep->pesoGeralMatriz),2,'.',',');
  253.                     $obj->sVolTotalAplicado number_format(($DDPV $rep->pesoGeralMatriz),2,'.',',');
  254.                     TForm::sendData('form_solucao',$obj);
  255.                 TTransaction::close();
  256.             
  257.             }
  258.             catch(Exception $e)
  259.             {
  260.                 new TMessage('error''<b>Erro</b> ' $e->getMessage());
  261.                 TTransaction::rollback();
  262.             }
  263.         
  264.         }  
  265.    
  266.    }
  267. }
  268. ?>

Classe que possui a composição</B>
  1. <?php
  2. /**
  3.  * Solucao Active Record
  4.  * @author  <your-name-here>
  5.  */
  6. class Solucao extends TRecord
  7. {
  8.     const TABLENAME 'solucao';
  9.     const PRIMARYKEY'idSolucao';
  10.     const IDPOLICY =  'max'// {max, serial}
  11.     
  12.     
  13.     private $reproducao;
  14.     private $soros;
  15.     private $hormonios;
  16.     private $aplicacao_hormonios;
  17.     /**
  18.      * Constructor method
  19.      */
  20.     public function __construct(2427 NULL$callObjectLoad TRUE)
  21.     {
  22.         parent::__construct(2427$callObjectLoad);
  23.         parent::addAttribute('pVolTotalAplicado');
  24.         parent::addAttribute('sVolTotalAplicado');
  25.         parent::addAttribute('idReproducao');
  26.     }
  27.     
  28.     /**
  29.      * Method set_reproducao
  30.      * Sample of usage: $solucao->reproducao = $object;
  31.      * @param $object Instance of Reproducao
  32.      */
  33.     public function set_reproducao(Reproducao $object)
  34.     {
  35.         $this->reproducao $object;
  36.         $this->idreproducao $object->id;
  37.     }
  38.     
  39.     /**
  40.      * Method get_reproducao
  41.      * Sample of usage: $solucao->reproducao->attribute;
  42.      * @returns Reproducao instance
  43.      */
  44.     public function get_reproducao()
  45.     {
  46.         // loads the associated object
  47.         if (empty($this->reproducao))
  48.             $this->reproducao = new Reproducao($this->idreproducao);
  49.     
  50.         // returns the associated object
  51.         return $this->reproducao;
  52.     }
  53.     
  54.     
  55.     /**
  56.      * Method addSoro
  57.      * Add a Soro to the Solucao
  58.      * @param $object Instance of Soro
  59.      */
  60.     public function addSoro(Soro $object)
  61.     {
  62.         $this->soros[] = $object;
  63.     }
  64.     
  65.     /**
  66.      * Method getSoros
  67.      * Return the Solucao' Soro's
  68.      * @return Collection of Soro
  69.      */
  70.     public function getSoros()
  71.     {
  72.         return $this->soros;
  73.     }
  74.     
  75.     /**
  76.      * Method addHormonio
  77.      * Add a Hormonio to the Solucao
  78.      * @param $object Instance of Hormonio
  79.      */
  80.     public function addHormonio(Hormonio $object)
  81.     {
  82.         $this->hormonios[] = $object;
  83.     }
  84.     
  85.     /**
  86.      * Method getHormonios
  87.      * Return the Solucao' Hormonio's
  88.      * @return Collection of Hormonio
  89.      */
  90.     public function getHormonios()
  91.     {
  92.         return $this->hormonios;
  93.     }
  94.     
  95.     /**
  96.      * Method addAplicacaoHormonio
  97.      * Add a AplicacaoHormonio to the Solucao
  98.      * @param $object Instance of AplicacaoHormonio
  99.      */
  100.     public function addAplicacaoHormonio(AplicacaoHormonio $object)
  101.     {
  102.         $this->aplicacao_hormonios[] = $object;
  103.     }
  104.     
  105.     /**
  106.      * Method getAplicacaoHormonios
  107.      * Return the Solucao' AplicacaoHormonio's
  108.      * @return Collection of AplicacaoHormonio
  109.      */
  110.     public function getAplicacaoHormonios()
  111.     {
  112.         return $this->aplicacao_hormonios;
  113.     }
  114.     /**
  115.      * Reset aggregates
  116.      */
  117.     public function clearParts()
  118.     {
  119.         $this->soros = array();
  120.         $this->hormonios = array();
  121.         $this->aplicacao_hormonios = array();
  122.     }
  123.     /**
  124.      * Load the object and its aggregates
  125.      * @param 2427 object ID
  126.      */
  127.     public function load(2427)
  128.     {
  129.     
  130.         // load the related Soro objects
  131.         $repository = new TRepository('Soro');
  132.         $criteria = new TCriteria;
  133.         $criteria->add(new TFilter('idSolucao''='2427));
  134.         $this->soros $repository->load($criteria);
  135.     
  136.         // load the related Hormonio objects
  137.         $repository = new TRepository('Hormonio');
  138.         $criteria = new TCriteria;
  139.         $criteria->add(new TFilter('idSolucao''='2427));
  140.         $this->hormonios $repository->load($criteria);
  141.     
  142.         // load the related AplicacaoHormonio objects
  143.         $repository = new TRepository('AplicacaoHormonio');
  144.         $criteria = new TCriteria;
  145.         $criteria->add(new TFilter('idSolucao''='2427));
  146.         $this->aplicacao_hormonios $repository->load($criteria);
  147.     
  148.         // load the object itself
  149.         return parent::load(2427);
  150.     }
  151.     /**
  152.      * Store the object and its aggregates
  153.      */
  154.     public function store()
  155.     {
  156.         // store the object itself
  157.         parent::store();
  158.     
  159.         // delete the related Soro objects
  160.         $criteria = new TCriteria;
  161.         $criteria->add(new TFilter('idSolucao''='$this->id));
  162.         $repository = new TRepository('Soro');
  163.         $repository->delete($criteria);
  164.         // store the related Soro objects
  165.         if ($this->soros)
  166.         {
  167.             foreach ($this->soros as $soro)
  168.             {
  169.                 unset($soro->idSoro);
  170.                 $soro->idSolucao $this->id;
  171.                 $soro->store();
  172.             }
  173.         }
  174.         // delete the related Hormonio objects
  175.         $criteria = new TCriteria;
  176.         $criteria->add(new TFilter('idsolucao''='$this->id));
  177.         $repository = new TRepository('Hormonio');
  178.         $repository->delete($criteria);
  179.         // store the related Hormonio objects
  180.         if ($this->hormonios)
  181.         {
  182.             foreach ($this->hormonios as $hormonio)
  183.             {
  184.                 unset($hormonio->idHormonio);
  185.                 $hormonio->idSolucao $this->id;
  186.                 $hormonio->store();
  187.             }
  188.         }
  189.         // delete the related AplicacaoHormonio objects
  190.         $criteria = new TCriteria;
  191.         $criteria->add(new TFilter('idsolucao''='$this->id));
  192.         $repository = new TRepository('AplicacaoHormonio');
  193.         $repository->delete($criteria);
  194.         // store the related AplicacaoHormonio objects
  195.         if ($this->aplicacao_hormonios)
  196.         {
  197.             foreach ($this->aplicacao_hormonios as $aplicacao_hormonio)
  198.             {
  199.                 unset($aplicacao_hormonio->idAplicacaoHormonio);
  200.                 $aplicacao_hormonio->idSolucao $this->id;
  201.                 $aplicacao_hormonio->store();
  202.             }
  203.         }
  204.     }
  205.     /**
  206.      * Delete the object and its aggregates
  207.      * @param 2427 object ID
  208.      */
  209.     public function delete(2427 NULL)
  210.     {
  211.         2427 = isset(2427) ? 2427 $this->id;
  212.         // delete the related Soro objects
  213.         $repository = new TRepository('Soro');
  214.         $criteria = new TCriteria;
  215.         $criteria->add(new TFilter('idSolucao''='2427));
  216.         $repository->delete($criteria);
  217.         
  218.         // delete the related Hormonio objects
  219.         $repository = new TRepository('Hormonio');
  220.         $criteria = new TCriteria;
  221.         $criteria->add(new TFilter('idSolucao''='2427));
  222.         $repository->delete($criteria);
  223.         
  224.         // delete the related AplicacaoHormonio objects
  225.         $repository = new TRepository('AplicacaoHormonio');
  226.         $criteria = new TCriteria;
  227.         $criteria->add(new TFilter('idSolucao''='2427));
  228.         $repository->delete($criteria);
  229.         
  230.     
  231.         // delete the object itself
  232.         parent::delete(2427);
  233.     }
  234. }
  235. ?>

Classe Soro
  1. <?php
  2. /**
  3.  * Soro Active Record
  4.  * @author  <your-name-here>
  5.  */
  6. class Soro extends TRecord
  7. {
  8.     const TABLENAME 'soro';
  9.     const PRIMARYKEY'idSoro';
  10.     const IDPOLICY =  'max'// {max, serial}
  11.     
  12.     
  13.     /**
  14.      * Constructor method
  15.      */
  16.     public function __construct(2427 NULL$callObjectLoad TRUE)
  17.     {
  18.         parent::__construct(2427$callObjectLoad);
  19.         parent::addAttribute('nomeSoro');
  20.         parent::addAttribute('descSoro');
  21.         parent::addAttribute('valorSoro');
  22.         parent::addAttribute('qtdeAplicSoroKvP');
  23.         parent::addAttribute('valorSoroAplicacao');
  24.         parent::addAttribute('idSolucao');
  25.        
  26.     }
  27. }
  28. ?>

Classe Hormonio
  1. <?php
  2. /**
  3.  * Hormonio Active Record
  4.  * @author  <your-name-here>
  5.  */
  6. class Hormonio extends TRecord
  7. {
  8.     const TABLENAME 'hormonio';
  9.     const PRIMARYKEY'idHormonio';
  10.     const IDPOLICY =  'max'// {max, serial}
  11.     
  12.     
  13.     /**
  14.      * Constructor method
  15.      */
  16.     public function __construct(2427 NULL$callObjectLoad TRUE)
  17.     {
  18.         parent::__construct(2427$callObjectLoad);
  19.         parent::addAttribute('nomeHormonio');
  20.         parent::addAttribute('descHormonio');
  21.         parent::addAttribute('valorHormonio');
  22.         parent::addAttribute('qtdeAplicKvP');
  23.         parent::addAttribute('idSolucao');
  24.         parent::addAttribute('valorHormonioAplicacao');
  25.     }
  26. }
  27. ?>

Curso completo Meu Negócio Pronto
Use para si, ou transforme em um negócio: Inclui aulas e códigos-fontes
Gestor de conteúdo (SITE) + Loja Virtual (E-Commerce) + Emissor de Notas para infoprodutos


Meu negócio pronto Quero me inscrever agora!

Comentários (3)


LC

No método store ai da classe solução, faz um delete ai em soro que é relacionada com solução, acho q é isso, só que não esta deixando deletar por causa do foreign criado dentro do banco entre as tabelas, eu acho que é isso.
LC

No método store ai da classe solução, faz um delete ai em soro que é relacionada com solução, acho q é isso, só que não esta deixando deletar por causa do foreign criado dentro do banco entre as tabelas, eu acho que é isso.
PD

www.adianti.com.br/forum/pt/view_1993?duvida-sobre-o-composicao-mant