0 Replies Latest reply on Jan 11, 2010 10:26 PM by kuvark kuvark

    manytoone and h:selectmanylistbox problem

    kuvark kuvark Newbie
      +

      hi all...
      i got a problem about my huge seam application. and i wanna ask the question in basic way.
      i got a manytomany relationship in my db. but when i run generate-entities all the time it gives me that relationship like manytoone .etc: my tables

      auto:
      DROP TABLE IF EXISTS `dene`.`auto`;
      CREATE TABLE  `dene`.`auto` (
        `auto_id` int(10) unsigned NOT NULL auto_increment,
        `auto_manufacturer_id` smallint(5) unsigned NOT NULL,
        `auto_model` varchar(20) NOT NULL,
        `model_year` smallint(5) unsigned NOT NULL,
        `asking_price` decimal(12,2) unsigned NOT NULL,
        PRIMARY KEY  (`auto_id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

      autofeature:
      DROP TABLE IF EXISTS `dene`.`autofeature`;
      CREATE TABLE  `dene`.`autofeature` (
        `auto_feature_id` smallint(5) unsigned NOT NULL auto_increment,
        `feature_name` varchar(80) NOT NULL,
        PRIMARY KEY  (`auto_feature_id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

      and their relationship table auto2autofeature:

      DROP TABLE IF EXISTS `dene`.`auto2autofeature`;
      CREATE TABLE  `dene`.`auto2autofeature` (
        `auto_id` int(10) unsigned NOT NULL,
        `auto_feature_id` smallint(5) unsigned NOT NULL,
        `id` int(10) unsigned NOT NULL auto_increment,
        PRIMARY KEY  (`id`),
        KEY `Index_2` (`auto_id`),
        KEY `Index_3` (`auto_feature_id`),
        KEY `FKDD0DC6242214BE8F` (`auto_id`),
        KEY `FKDD0DC62445112526` (`auto_feature_id`),
        CONSTRAINT `FKDD0DC62445112526` FOREIGN KEY (`auto_feature_id`) REFERENCES `autofeature` (`auto_feature_id`),
        CONSTRAINT `FKDD0DC6242214BE8F` FOREIGN KEY (`auto_id`) REFERENCES `auto` (`auto_id`),
        CONSTRAINT `FK_auto2autofeature_1` FOREIGN KEY (`auto_feature_id`) REFERENCES `autofeature` (`auto_feature_id`),
        CONSTRAINT `FK_auto2autofeature_2` FOREIGN KEY (`auto_id`) REFERENCES `auto` (`auto_id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


      i tried all the methods but i know how to create manytomany relationship , i think... all the time seam gave me manytoone relationship and i need to use h:selectmanylistbox.

      any idea? thanks