Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the most of the cases, in tosca model template there is compatibility in field types. Only two types (java.util.Date and Boolean) are not compatible between Eclipse-Link and Hibernate.

Note about precision in DATETIME (https://mariadb.com/kb/en/datetime/): MariaDB can store microseconds with a precision between 0 and 6. If no microsecond precision is specified, then 0 is used by default.

Code Block
titleJpaExample
collapsetrue
@Embeddable
@Data
public class ExampleKey implements Serializable {

    private static final long serialVersionUID = 1L;

    @Column(name = "name", length = 120)
    private String name;

    @Column(name = "version", length = 20)
    private String version;
}

@Entity
@Table(name = "Example")
@Data
public class JpaExample implements Serializable {

    private static final long serialVersionUID = 1L;

    @EmbeddedId
    @VerifyKey
    @NotNull
    private ExampleKey key;

    @Column
    private Boolean primed;

    @Column(name = "timeStamp", precision = 3)
    @Temporal(TemporalType.TIMESTAMP)
    @NotNull
    private Date timeStamp;
}

...