1

We have received claimed working source code. In code, all the entity model classes (hbm2java) are auto generated by Hibernate Tools 4.0.0 (checked by generated class java docs). We are trying to perform reverse engineering to generate database schema from models with mysql databse.

MySQL : 5.1.46-community MySQL Connector : mysql-connector-java-5.1.46 Hibernate : Hibernate3

Here we are facing many errors:

Too many key parts specified; max 16 parts allowed

I am pasting the code of one such Entity class for which we are getting above error

@Entity
@Table(name = "ABC")
public class Abc implements java.io.Serializable {

    private AbcId id;

    public Abc() {
    }

    public Abc(AbcId id) {
        this.id = id;
    }

    @EmbeddedId
    @AttributeOverrides({
            @AttributeOverride(name = "a", column = @Column(name = "A", nullable = false)),
            @AttributeOverride(name = "b", column = @Column(name = "B", nullable = false, length = 10)),
            @AttributeOverride(name = "c", column = @Column(name = "C", nullable = false, length = 2)),
            @AttributeOverride(name = "d", column = @Column(name = "D", nullable = false)),
            @AttributeOverride(name = "e", column = @Column(name = "E", nullable = false, precision = 12)),
            @AttributeOverride(name = "f", column = @Column(name = "F", nullable = false, precision = 12)),
            @AttributeOverride(name = "g", column = @Column(name = "G", nullable = false, length = 400)),
            @AttributeOverride(name = "h", column = @Column(name = "H", length = 400)),
            @AttributeOverride(name = "i", column = @Column(name = "I", nullable = false, length = 1)),
            @AttributeOverride(name = "j", column = @Column(name = "J", nullable = false, length = 2)),
            @AttributeOverride(name = "k", column = @Column(name = "K", nullable = false, length = 1)),
            @AttributeOverride(name = "l", column = @Column(name = "L", nullable = false, length = 100)),
            @AttributeOverride(name = "m", column = @Column(name = "M", length = 100)),
            @AttributeOverride(name = "n", column = @Column(name = "N", nullable = false, length = 23)),
            @AttributeOverride(name = "o", column = @Column(name = "O", nullable = false, length = 100)),
            @AttributeOverride(name = "p", column = @Column(name = "P", length = 23)),
            @AttributeOverride(name = "q", column = @Column(name = "Q", length = 100)),
            @AttributeOverride(name = "r", column = @Column(name = "R", nullable = false, length = 100)) })
    public AbcId getId() {
        return this.id;
    }

    public void setId(AbcId id) {
        this.id = id;
    }
}

This is a auto generated class by Hibernate Tools 4.0.0

Parth
  • 29
  • 4
  • Hi @parth : It will be help to get answers if you can mention some more details like the MySQL version, MySQL connector jar version, Hibernate Version which you are using – Vishal Zanzrukia Jul 11 '20 at 07:47

0 Answers0