Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Java HotSpot(TM) 64-Bit Server VM warning: erro rodando testes

Ao rodar o teste esta retornando os erros abaixo:

2024-02-01T11:21:17.148-03:00 INFO 6572 --- [ main] c.g.p.h.a.d.medico.MedicoRepositoryTest : Started MedicoRepositoryTest in 10.8 seconds (process running for 13.245) Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended Hibernate:

2024-02-01T11:21:18.392-03:00 ERROR 6572 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: function rand() does not exist Dica: No function matches the given name and argument types. You might need to add explicit type casts. Posição: 369

org.springframework.dao.InvalidDataAccessResourceUsageException: JDBC exception executing SQL [select m1_0.id,m1_0.ativo,m1_0.crm,m1_0.email,m1_0.bairro,m1_0.cep,m1_0.cidade,m1_0.complemento,m1_0.logradouro,m1_0.numero,m1_0.uf,m1_0.especialidade,m1_0.nome,m1_0.telefone from medicos m1_0 where m1_0.ativo=true and m1_0.especialidade=? and m1_0.id not in(select c1_0.medico_id from consultas c1_0 where c1_0.data=? and c1_0.motivo_cancelamento is null) order by rand() fetch first 1 rows only] [ERROR: function rand() does not exist Dica: No function matches the given name and argument types. You might need to add explicit type casts. Posição: 369] [n/a]; SQL [n/a]

at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:256)
1 resposta
solução!

Bom dia.

Como estou utilizando o bando postgreSql, a função rand() não funciona, tive que alterar para random().

Problema resolvido.