0 Replies Latest reply on Jan 27, 2006 2:49 PM by Mike Osganian

    SecondaryTable problem

    Mike Osganian Newbie

      Hi I'm using JBoss 4.0.3SP1 and I have an entity bean that stores its data in 2 tables that are joined by an id. My class looks like:

      public class User implements Serializable {
       int id;
       String username = null;
       String firstName = null;
       public int getId() {
       return id;
       public void setId(int id) {
       this.id = id;
       public String getUsername() {
       return super.getUsername();
       public void setUsername(String name) {
       this.username = name;
       @Column(name="firstName", secondaryTable="users2")
       public String getFirstName() {
       return firstName;
       public void setFirstName(String firstName) {
       this.firstName = firstName;

      But I get the following exception when I run:

      java.sql.SQLException: Unknown column 'firstName' in 'field list'
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
       at com.mysql.jdbc.Connection.execSQL(Connection.java:2994)
       at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936)
       at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1166)
       at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1082)
       at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1067)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2064)

      What am I missing?

      Any help would be great!