I am trying to update my knowledge in Java since I last used it when it was in version 1.4.X ... I am trying to use 1.6.0, in particular the Java Persistence API (2.0).
I managed to create an entity class. It works as I can store and retrieve data.
But I was cheating, and when I decided to populate the JList with the column names of the table and did not get success ...
This is a simple class and looks like this:
@Entity @Table(name = "T_CURRENCY", schema = "APP") public class Currency implements Serializable { @Transient private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this); private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "ID") private Short id; @Basic(optional = false) @Column(name = "NAME") private String name; ... }
Is there a way to get column names?
I found this post . This seems to be the right solution, but I thought it might have something lighter / more elegant? I donโt know why, but I was expecting a method already done ...
TIA
Bean
Bob rivers
source share