Versions Compared

Key

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

...

Schema generation


Boolean and TimeStamp

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.

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;
}

...