Hi I am using Spring Boot 2 (2.0.1.RELEASE) with the default Hibernate version with H2 db and I have a problem with the field sizes in the table that is generated when using @Embeddable. Here is my code: @Entity public class Publisher { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; @NotBlank @Size(min=2, max=150) private String name; @NotNull private Address address; ... } @Embeddable public class Address { @NotBlank @Size(min=3, max=100) private String street; @NotBlank @Size(min=2, max=100) private String city; @NotBlank @Size(min=2, max=100) private String county; @NotBlank @Size(min=7, max=8) private String postcode; ... } When Spring Boot fires up it creates the tables in H2. The column size in the 'name' attribute in Publisher is correctly set up to 150 using the max value from the @Size annotation. The max values in the @Size annotations for the embedded Address entity is ignored and set to 255 chars max for all 4 fields. Is this the expected behaviour or should the db columns from the embedded fields be set to the max value from the @Size annotations in the Address entity? I know I can set this using the length value of the @Column annotation but I was hoping to get this working without the extra @Column annotation. I originally raised this question on StackOverflow and was asked to submit this here: https://stackoverflow.com/questions/50104083/spring-boot-2-hibernate-5-embeddable-attributes-generates-the-wrong-field-size/50104855#50104855 Test case: https://github.com/hibernate/hibernate-test-case-templates/tree/master/orm/hibernate-orm-5 I haven't used Jira for a very long time so I apologise in advance if I make any mistakes in raising this issue. Thank you Kaz |