using hibernate.hbm2ddl.auto property to Validate
model generated
// Generated Apr 9, 2018 4:54:27 PM by Hibernate Tools 5.2.8.Final
using lastest mysq connector mysql-connector-java-5.1.46.jar
it generates this annotation for field descripcion
@Column(name = "descripcion", length = 16777215)
table is
CREATE TABLE `deposito_cajas_compuestas_entrada` (
`id_caja_entrante` INT(11) UNSIGNED NOT NULL,
`id_caja_compuesta` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`cantidad` INT(11) UNSIGNED NOT NULL,
`descripcion` MEDIUMTEXT NULL,
PRIMARY KEY (`id_caja_compuesta`, `id_caja_entrante`),
INDEX `id_caja_entrante` (`id_caja_entrante`) USING BTREE,
CONSTRAINT `deposito_cajas_compuestas_entrada_ibfk_1` FOREIGN KEY (`id_caja_entrante`) REFERENCES `deposito_caja_entrante` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=14
;
mysql -V:
mysql Ver 14.14 Distrib 5.7.20, for Linux (x86_64) using EditLine wrapper
when trying to create the EMF i get this error
org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column type encountered in column [descripcion] in table [deposito_cajas_compuestas_entrada]; found [mediumtext (Types#LONGVARCHAR)], but expecting [longtext (Types#VARCHAR)]