Monday, 15 September 2014

java - Hibernate, collections, save only certain properties -


I want to map the following entities, but I ran into some problems with Hibernate.

Organizations:

@Entity Public Class MyObject {@Id @GeneratedValue Long ID; @column (name = "one") int intInt; Set up & lt; MapValue & gt; Map = new hashet ...} @ entity public class map value {@Id @ generatedValue long id @Column (name = "text") public string text; Public double number; }

The value of the field "number" should be calculated after the property "text" is set

If you want a" count "field, then the database should not be retained, annotate it with the @transient .

  @transient public double number;  

No comments:

Post a Comment