Nelson Gomes

Greenhorn
+ Follow
since Jul 21, 2016
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nelson Gomes

From my java application I am trying to send a msg to Microsoft teams

When run from my mac works perfect

When I run from a Docker Container I am receiving a certificate error msg


error:
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target


Any Ideas ?

Docker Image:

FROM alpine:3.10.3 ARG sha=‘HEAD’ LABEL vcs-ref=$sha

ENV APP_USER=“app”

RUN adduser -H -S -D “${APP_USER}”

WORKDIR /app

RUN apk update && apk add --no-cache openjdk11-jdk python3 py3-pip py3-setuptools py3-six jq curl bash && pip3 install --upgrade pip==19.3.1 && pip install --upgrade awscli boto3 && rm -rf /root/.cache && apk del py3-pip py3-setuptools build-base linux-headers pcre-dev openssl-dev && rm -rf /var/cache/apk/*

ENV JAVA_HOME=/usr/lib/jvm/default-jvm ENV PATH="{JAVA_HOME}/bin:{PATH}"

Code: List configsMsTeams = configMsTeamsRepository.findAll(); String url = “”;

   if (configsMsTeams.size() <= 0) {
       return;
   }

   url = configsMsTeams.get(0).getUrl();

   String message = notification.getMessage();

   Card card = new Card("Card \"Test card\"", "0078D7",
       "Cargo ID: " + notification.getData().get("cargoId"));

   card.setText(message);

   new TeamsClient(url).sendMessage(card);
} catch (Exception e) {
   LOG.error("Error while sending notification to teams: ", e.getMessage());
}
4 years ago
Hello , I think this is a simple question

I have a entity A and inside this entity i have a entity B

Entity A

String Name,

One to Many
Cascade Persist
Entity B

I start the process with a valid entity A, with entity B as null

First I use a find method to get entity A from database

Them I save entity B in Database

Ps. I am not able to save entity A at this point, ok ?

The data is updated in the database, entity A has entity B as a foreign key

Them I run another find in entity A

and the data is old, entity B still null

I´ve tried cascade refresh, isolation and propagation , and nothing

I am using spring boot, jpa repository, java 11

I know if i find for entity B, and navigate to entity A is going to work

But is there any sollution

Thanks in Advance
Nelson Gomes
4 years ago
Please help me , I need to use having clause in Hibernate

Sorry how do use having clause in hibernate ?
Seems that it´s not recognizing having clause

Look at my code


String queryDB = "select med.normalizedNif from MvEntityDepuration med WHERE";

if(nif){

  queryDB += " med.normalizedNif HAVING count(*)>1 group by med.normalizedNif ";
}

LOGGER.debugv("Nelson: Query a Rodar: {0}", queryDB);

List<Object[]> dataInDb =  em.createQuery(queryDB, Object[].class).getResultList();


error: Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: having near line 1, column 101 [select med.normalizedNif from pt.infarmed.gent.model.MvEntityDepuration med WHERE med.normalizedNif having count(*)>1 group by med.normalizedNif ]




Hello All,

I need something really simple, but need your help to do this

I am using Hibernate with Oracle Database, and I am performing a Full query using "select b from Biossimilar_Entity b" as you can see bellow


But I need two things, I need to apply to filters using Date Field;


First:

I need to get this list ordered by date , from the first to last.. Examplo: 01012015 then 01022015, then 01032015, etc. DD/MM/YYYY

Second

I need to get same list , but I only need the last 12 months.... when I get this list today 27/07/2016 , i will need all months starting in 01/07/2015

Could someone help me please?
Thanks a lot for your help.
7 years ago
JSF
Hello.

Is it possible to draw a 3D pie chart using primefaces ?

I am sucessfully drawing a pie chart, but i dont know how to set to 3d.

Please Help.
7 years ago
JSF
I am using JSF 2.2 and PrimeFaces The Basic question is: I need to call a home page from a manage bean class.. simple like that...

@ManagedBean public class ChartViewBarModel implements Serializable { Insert a method here. }

Is it possible? If yes , What i need to do ?
7 years ago
JSF