-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate 5.0.2 and MySql 5.6
PostPosted: Tue Oct 06, 2015 11:20 am 
Beginner
Beginner

Joined: Sat Oct 09, 2004 2:35 pm
Posts: 43
Location: Tenerife
This id column annotation:
Code:
@Column(name = "ID", nullable = false)
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "genAmortizaId")
    @Id
    @javax.persistence.SequenceGenerator(name = "genAmortizaId",
        sequenceName = "AMO_GEN_ID")
    private Long id;

worrked prefectly in prevous release 4.3.11 using dialect MySQL5InnoDBDialect cause MySql does not support sequences and AUTO was translated to ID.
But using release 5.0.2 Hib tries to use sequences and, of course, MySQL complains.
The reason why I left SequenceGenerator behind is because, depending on Dialect passed, I can use MySQL or Oracle.

Besides, if I try to generate DDL using SchemaExport (that worked previously with no problem) Tables are completely wrong generated.
I can give Model used, if needed, but I suggest a previous Test using this Id and next Table annotation:
Code:
@DynamicInsert
@DynamicUpdate
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@OptimisticLocking
@Table(name = "AMORTIZA",
    uniqueConstraints = {
        @javax.persistence.UniqueConstraint(name = "AMO_IDX_AMORTIZA",
            columnNames = { "INMOVILIZADO_ID", "CODIGO" })
    })
@org.hibernate.annotations.Table(appliesTo = "AMORTIZA",
    comment = "Datos para fiscal")
public class Amortiza

and any other column and you will see how last part of Table is (using ! delimiter)
Code:
) ENGINE=InnoDB!
comment='Datos para fiscal'!

and Id is not properly generated
and validators like @NotNull are not used for DDL...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.