primary key as char

Asked

Viewed 164 times

0

I have a table as a primary key char(1) in sql server using jtds driver.

public class Situacao{

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "cod_sit_pedi_aval")
private Character codSitPediAval;

}

public class Pedido{

@ManyToOne
@JoinColumn(name = "cod_sit_pedi_aval")
private Situacao situacao;
}

Only when I update I get the following error: IJ031042: Method is not implemented by JDBC driver

Caused by: java.lang.AbstractMethodError
  at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.setCharacterStream(JtdsPreparedStatement.java:1274)
  at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.setCharacterStream(WrappedPreparedStatement.java:1466)

How can I solve this problem?

  • I don’t think you can use the GeneratedValue field Character. That field is not predefined, on a charge or something?

  • I’ll change here

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.