Trigger usando hibernate

0 respostas
M

Ola boa noite estou fazendo um trabalho pra faculdade estou usando hibernate como teste
a trigger fuciona certo porem a consulta com hibernate tras apenas 3 resulltado alguem poderia me ajudar?
segue a classe e os resultados

@Entity

@Table(name=aditoria)

public class Auditoria {

@Column(length=70)

@Id

String usariocodigo;

@Column(length=20)

String tipooperacao;

@Temporal(value =TemporalType.TIMESTAMP)

Date dataoperacao;

@Column

Integer chave;

@Column(length=70)

String ante;

@Column(length=70)

String depois;

Metdo da  dao de pesquisa

public List pesquisarLog() {

Session session = HibernateUtil.geSessionFactory().openSession();

List atividadelog = new ArrayList<>();

StringBuilder sql = new StringBuilder();
try {
	
	sql.append	("select aditoria from Auditoria  aditoria   ");
	    
	Query consulta = session.createQuery(sql.toString());

		
		atividadelog = consulta.list();
	} catch (RuntimeException e) {
		throw e;
	} finally {
		session.close();
	}

	return atividadelog;

}

dados no banco de dados
usariocodigo ante chave dataoperacao depois tipooperacao


root@localhost (NULL) 1 2018-07-24 23:04:18 TESTE1 INSERÇÃO
root@localhost (NULL) 1 2018-07-24 23:05:07 ESCREVENDO INSERÇÃO
root@localhost ATIVIDADE1 1 2018-07-28 23:34:28 ATIVIDADE5 ALTERAR
root@localhost (NULL) 1 2018-07-28 23:41:58 NOVA INSERÇÃO
root@localhost ATIVIDADE5 1 2018-07-28 23:42:44 ATIVIDADE10 ALTERAR

n a cosulta do apere o priemeiro

Criado 29 de julho de 2018
Respostas 0
Participantes 1