public void save(T entity) throws DAOException {
getSession().saveOrUpdate(entity);
}
public void salvar(Nota nota) {
try {
notaDao.getSession().beginTransaction();
notaDao.save(nota);
notaDao.getSession().getTransaction().commit();
} catch (DAOException e) {
e.printStackTrace();
}
}
public class Nota implements Serializable{
private static final long serialVersionUID = -8430330159524494606L;
@Id
@Column(name="nota", length=12)
private int nota;
@Id
@Column(name="sequencia", length=3)
private int sequencia;
@Id
@Column(name="cod_idimento", length=10)
private int codIdimento;
@Id
@Column(name="cod_fornecedor")
private int codFornecedor;
@Id
@Column(name="tipo", length=3)
private String tipo;
@Id
@Column(name="data")
private Date data;
@Id
@Column(name="hora", length=6)
private String hora;
@Column(name="protocolo", length=10)
private int protocolo;
Se alguem puder ajudar, agradeço.