facebook

how to generate one-to-one relation?

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #261871 Reply

    henry42
    Member

    I tried many times when i generate the mapping relation.
    But myeclipse(5.0 with eclipse 3.2) still make it just be many-to-one mapping relation with the attribute unique=true.
    How to generate one-to-one mapping relation?

    What’s the wrong?

    I use MySql.

    my two table are:
    1)
    create table `henrydb`.`address`(
    `id` int unsigned default ” not null,
    `phone` varchar(45) default ” not null,
    primary key (`id`)
    );

    alter table `henrydb`.`address`
    add index `FK_address_1`(`id`),
    add constraint `FK_address_1`
    foreign key (`id`)
    references `henrydb`.`user`(`id`);
    create unique index `PRIMARY` on `henrydb`.`address`(`id`);

    2)

    create table `henrydb`.`user`(
    `id` int unsigned not null auto_increment,
    `username` varchar(45) default ” not null,
    primary key (`id`)
    );

    create unique index `PRIMARY` on `henrydb`.`user`(`id`);

    thx for help.

    #261916 Reply

    Haris Peco
    Member

    henry42,

    MyEclipse doesn’t support one-to-one relation, for now.

    Sorry for the inconveince caused.

    Regards,

    #261918 Reply

    Riyad Kalla
    Member

    o2o mappings are not supported at this time, but it is something we are looking at for a future release.

    #309440 Reply

    Nigel Schoon
    Participant

    I have been trying to get this to work most of today, then found this posting from 2006.
    Four tables that should be 1-1, only one comes through Hibernate to MyEclipse version 8.5.
    Is the o2o issue fixed?

    MySQL 5.1.3, schema designed in mysql workbench.

    thanks
    Nigel

    #309441 Reply

    Nigel Schoon
    Participant

    I have been trying to get this to work most of today, then found this posting from 2006.
    Four tables that should be 1-1, only one comes through Hibernate to MyEclipse version 8.5.
    Is the o2o issue fixed?

    MySQL 5.1.3, schema designed in mysql workbench.

    thanks
    Nigel

    #309442 Reply

    Nigel Schoon
    Participant

    I have been trying to get this to work most of today, then found this posting from 2006.
    Four tables that should be 1-1, only one comes through Hibernate to MyEclipse version 8.5.
    Is the o2o issue fixed?

    MySQL 5.1.3, schema designed in mysql workbench.

    thanks
    Nigel

    #309471 Reply

    Nigel,

    Four tables that should be 1-1, only one comes through Hibernate to MyEclipse version 8.5.

    Can you clarify what exactly is happening?
    Can you send us the table scripts and the list of steps in detail to reproduce your issue?

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: how to generate one-to-one relation?

You must be logged in to post in the forum log in