Skip to content
Advertisement

Tag: java

Multiple ‘as-value’ properties defined

I want to create a ENUM which holds different statuses for possible database values and use them also to generate possible drop down statuses in FE: Full code: https://github.com/rcbandit111/Search_specification_POC/blob/main/src/main/java/org/merchant/database/service/businesscustomers/BusinessCustomersStatus.java But when I make a POST request to add a new record I get this error: Note that I have changed TicketStatus with BusinessCustomersStatus into the error stack. When I make

How to generate trace ID in AWS format

I would like to use opentelemetry-java-instrumentation with AWS OTEL collector and X-Ray. Unfortunately, AWS OTEL aws-xray exporter is not able to export generated traces to X-Ray because generated trace ID is invalid X-Ray trace ID: How to instrument my opentelemetry-java-instrumentation 1.7.0 to generate trace IDs in X-Ray format? I’ve tried to add aws extension + env variables: without success. Answer

How does the double-dot “..” syntax work in AspectJ?

i need to put this aop aspect to work, but i always get error 404, i need to know if this dots, after controller is right. idk how these dots works, to acess the controller. if can explain how the dots works. Answer would mean – the execution of any method defined in the com.teste1.teste2.web.controller package or one of its

Using Generics for return type parameter Java

I am trying to create a method that will return a generic type parameter. I have a class VehicleOrder that extends the abstract class Order. In class Order, I created an abstract method receiveHiredObject. This method will not receive any parameter and will return a generic. I implemented this method in the class VehicleOrder and I set it up to

How to simplify String concat in java?

Given the following code: I am trying and discussing in the team how the simpliest code could look like while one could use also constructs like: org.apache.commons.lang3.StringUtils: defaultString() MoreObjects.firstNonNull(user.getVorname(), Strings.EMPTY) A possible test could be like (expected results are visible here too): Any ideas welcome… what could I try? BTW: java 17 is allowed 🙂 The following code seemss to

Single return type in Hibernate Search

Let’s say I have an app with many different entities, which do not have relations between each other. I would like to create a search that queries all of them, but returns a unified type, i.e: So my idea was to index the entities and put their values into one single index (with same index fields): As you can see,

Advertisement