how do i make it so i only have to type “onion” instead of typing the whole thing. I am trying add a String for the Flavour of PackOfCrisps, but i have to type: new PackOfCrisps(“onion”) this is what i have done for the method and this is the interface i get where i have to type: new PackOfCrisps(“onion”) Answer
Get records which are last updated in n minutes in jpa
I am working on a jpa query which requires to fetch all the records whose last updated time is more than 15 minutes My query goes like I will be passing the minutes dynamically ie in my jpa This does not work. I want to pass the minute dynamically. Can someone please help me with this Answer You can use
Regex to validate that every digit is different from each other
I have to validate strings with specific conditions using a regex statement. The condition is that every digit is different from each other. So, 123 works but not 112 or 131. So, I wrote a statement which filters a string according to the condition and prints true once a string fullfies everything, however it only seems to print “true” altough
Complex logix in Java Comparator
I have a list of actors where each actor has a type (“Artist”, “Producer”, “Mixer”…some other types). I need to order this list taking the following into consideration: Actors with the type of “Artist” will be displayed first. Actors with the type of “Producer” will be displayed next. Actors with the type of “Mixer” will be displayed next. All actors
How to call servlet after running JavaScript verification code?
I am trying to run a character length check first and if user pass that than want to call the servlet which will return that user logged in. After running the above jsp code it is checking the password length and Rno check correctly but not running the servlet after that given below. I want to do this in doPost
how do I make while loop run until a certain input is placed?
the idea is basically the loop takes in input and it runs until I type “quit” but it doesn’t work the way I want to and I can’t figure out why 🙁 (p.s. im a beginner that came from python pls be kind) I also tried adding a temporary variable so that the while loop could check the condition before
How to convert String to Json Object in java or groovy
I saved a json into the database as a string like this: “[_district:_1_2_5village, _name:_1_1_2id_inter, _gender:_1_3_5sex]” Now i want to convert it back to a Json Object so as to pick the key and value eg _district is the key and _1_2_5village is the value. Any help on how i can achieve this. Thanks I tried to convert the string back
Spring Cloud API Gateway JWT Issue Web Token Issue
I have a problem about sending any request to a defined service through api gateway with the usage of bearer token coming from login. After login, I tried to send a request to a defined service but I got this issue in JWTAuthenticationFilter of api gateway shown below. The exact location is in JWTUtils class with this line shown below.
How can I shorten many while loops?
This is one of my first attempts to use Java and I tried my best, but I need to shorten it so it’s not so long. Important is that it keeps all the coins of the Euro. It’s a German code so geld means money. This part of the code System.out.println(rgeldt + ” mal 2 Euro”); just means how often
Spring @Transactional with base and subclasses
I am confused about @Transactional annotation with base and subclasses. I have the following code with several generic subclasses derived from the base class CustomRepository<T> which implements ICustomRepository<T>. I want all the methods of the interface ICustomRepository<T> be transactional. Is it enough to put @Transactional just in the base class so that the call findAll() from sublasses also become transactional.