Category "java"

Spring Data JPA: how to make one to one relationship with SQL Server JSON column

Spring Data JPA: how to make one to one relationship with SQL Server JSON column? Class EntityA { long id; @Type(type = "json") @Column(columnDefinition =

Adding 2nd fxml within pane of 1st fxml

I'm brand new to javafx so apologies for the basic question! My question is how to add a 2nd fxml inside a pane from the 1st fxml. I've got a mini program here.

User profile fragment Setting

i am creating small app with login and signup option and also with profile fragment so that user can update their profile later. i design my user profile layout

Hibernate handles id assigning instead of database

I have an auto-increment PK in a table and I want hibernate to handle id assigning instead of database. As my understanding the @GeneratedValue(strategy = Gener

How to use a For loop to read user inputed data?

How do i change my code to when i entered a number/integer the program will read it instantly goes on and the inputted integer will not appear in the bottom. ju

R2DBC pool closes all connections before each query

We're using the latest versions of spring-data-r2dbc, r2dbc-pool and r2dbc-postgresql for connecting to a PostgreSQL database using a connection pool. We notice

Upgrade from Elasticsearch 5.2.1 to 6.8.22 encounter issue: java.lang.LinkageError

Our project need to upgrade elasticsearch from 5.2.1 to 6.8.22. We encounter an issue now. The war can be deployed successfully in jboss server, but will contin

selecting one file/folder from the directory

I am building a program that manages the quantity and distribution of files and folders from folder "a" to "b" in java (io , nio, apache commons-io) libs. I got

How to convert a arraylist <String> to arrayList <Integer> and Calculate the values of Integers on it?

How i am supposed to calculate ArrayList String from Listview values into ArrayList Integer and back to Listview, Because i've been making a application for And

How to convert String having key=value pairs to Json

myString = {AcquirerName=abc, AcquiringBankCode=0.2, ApprovalCode=00}; I want to convert it to the following string. {"AcquirerName": "abc", "AcquiringBankCode

What is a NullPointerException, and how do I fix it?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause

MockMVC - Service method does not appeared to be called, works in postman, responding with null for test

I am trying to test the controller for creating a new league method, but it just returns null, and when I put a system.out.println in the service impl method, i

Java Maven - CVE-2017-1000487 on plexus-utils-2.0.4.jar plexus-utils-3.0.10.jar

Small question regarding Java and maven please. With a very simple project, reproducible 100%, with just this code snippet (please feel free to copy paste) <

What does a generic type before the type name in a constructor call mean?

What does the code mean like this? new <Number>ArrayList() I know the correct way to write it like this new ArrayList<Number>() The first is not a g

Why there is no compilation error when I am using different data types for switch expression and case value in this case

public class Conditionsif { public static void main(String[] args) { // TODO Auto-generated method stub int day=1; switch(day){

Why does the PrintWriter class (and other writers) require a call to flush after writing?

I have noticed that some I/O Classes in Java (and a lot others, like the BufferedWriter and FileWriter), require a call to flush() after writing. (With the exce

Using If in RecyclerView, doesnt show all the item of the list

I am trying create a RecycleView for my chat application and to align the sent and arrived messages to the left and right. I used an if state to check if that i

Custom IdentifierGenerator returns null

So, I want to customize the ID for a "FriendID" with IdentifierGenerator, and I want to make it as simple as possible first just to make sure it works. Been wat

Spring one Controller for nested entities

I'm working on a school project and I'm not sure how to implement this case. I would like to implement it as best practice. Right now I have 3 entities -> St

Is there a way to make a button to loop user inputs for a number of times before terminating?

I have been turning the popular guessing game into an app using Java in Android Studio. I want it so that a user can make up to five trials before the answer is