Example:
List<Subdivision> subdivision = session.createQuery(sql).list();
As far as I know in the Subdivision class, there must be a default constructor - it is there.
I have 3 fields in the Subdivision class:
-
@Id @GeneratedValue (strategy = GenerationType.IDENTITY) private int idSubdivision;
-
@Column(name = "nameSubdivision", unique = true) private String nameSubdivision;
-
@Transient VBox vbox; (javafx.scene.layout.VBox)
The first two fields are filled in using session.createQuery (sql) .list ();
But I need the third field of vbox to be filled in the Subdivision class. It is filled in from me based on the value of the nameSubdivision field. In the database, the vbox field is of course not present, so it does not fill out.
Of course I can go through the generated List subdivision and fill in this field.
But I wanted to do everything at once. Can I access session.createQuery (sql) .list () - and override it so that it takes into account my field