Lesson - 19 : Hibernate - Timestamp feature in Hibernate

preview_player
Показать описание
1. Hibernate has provided a feature called Timestamp.
2. With this feature the hibernate stores the system date and time in a database table along with the object whenever an object is inserted or updated.
3. We can not apply versioning and timestamp feature of an hibernate simultaneously in an application only one can be applied.

public class Product{
private int productId;
private String productName;
private double price;
private Timestamp timestamp;
}

<timestamp name="timestamp" column="timestamp"/>

In database add or alter the table products and add a column tipstamp for the table.
SQL>alter table products add tstamp tipstamp;

Execute ProductInsertClient and find the data inserted into the table in table the data will be inserted like the following.
Pid Pname price version
141 LG 6000 20-aug-13 08.01.23.23456pm

Рекомендации по теме
Комментарии
Автор

Your playlist is almost complete. did you made videos about date, date conversion in hibernate?

momedalhouma
welcome to shbcf.ru