db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zé Carlos" <ze.carlo...@gmail.com>
Subject Foreign Key
Date Wed, 19 Nov 2008 14:00:31 GMT
Hello, probably i have a silly question, I was testing torque and i have a
schema with a onte-to-one relation mapped like this:

    <table name="novos_jogadores" javaName="NovoJogador">
        <column name="id" javaName="id" primaryKey="true" required="true"
type="INTEGER" />
        <foreign-key foreignTable="jogadores" name="id">
            <reference local="id" foreign="novo_jogador_id" />
        </foreign-key>
    </table>

    <table name="jogadores" javaName="Jogador">
        <column name="id" javaName="id" primaryKey="true" required="true"
type="INTEGER" />
        <column name="novo_jogador_id" javaName="novoJogadorId"
type="INTEGER" />
        <foreign-key foreignTable="novos_jogadores" name="novo_jogador_id">
            <reference local="novo_jogador_id" foreign="id" />
        </foreign-key>
    </table>

on the table 'novos_jogadores' i mapped 'id' as foreign key referencing a
foreign key on 'jogadores', this forces the generator to build a
NovoJogadorPeer.getJogador(NovoJogador x), is any problem with this kind of
mapping with updates, deletions and insertions?

regards

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message