0

Is it possible, with Hibernate Tools, to generate POJO files avoiding the generation of entity classes on tables with composite primary keys?

I have this table with composite key:

CREATE TABLE `arc_test` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `data` datetime DEFAULT NULL,
  `text` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`,`data`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

And this

<hibernate-reverse-engineering>  
    <table name="arc_test" catalog="db">
        <primary-key>
            <generator class="native"/>
        </primary-key>       
    </table> 
</hibernate-reverse-engineering> 

Hibernate Tools generated this two class:

public class ArcTest implements java.io.Serializable
{
    private ArcTestId   id;
    private String      text;
    .....
    .....

public class ArcTestId implements java.io.Serializable
{
    private Integer id;
    private Date    data;
        .....
        .....

but I would like only one class like this:

   public class ArcTest implements java.io.Serializable
    {
        private Integer id;
        private Date    data;
        private String  text;
        .....
        .....

is it possible?

Augusto
  • 28,839
  • 5
  • 58
  • 88
Carlo Camusso
  • 51
  • 1
  • 9

1 Answers1

0

Like I told you on Discourse, it's not yet possible, but you can create a JIRA issue for this.

Christian Beikov
  • 15,141
  • 2
  • 32
  • 58