How can I store currency / price values

Hi all,

I have a simple question.
How can I store prices / currency in JPA / Hibernate?

Currently I´m saving it in double, which is rong.

@Column(name = "sum_total_payed")
private double sumTotalPayed

So I have to store it better in BigDecimal:
I need two values after the comma.

How can I do this and what is the correct code syntac for this?

Many thanks

You can use the @Column annotation to specify the precision (number of overall digits) and scale (number of decimal digits from the overall digits) for this purpose.