Skip to content

Tag: java

In which database JpaRepository uses by default?

When we using methods that come from JpaRepository like save, in which database spring boot use? and how can we change the default database if necessary? Answer It uses the database which you have configured in your properties file. You can change the database using the following properties(MySQL example):

Java Sort List Based Off Intersections

I’m trying to see how I can sort a list using streams where items that exist in a separate hashset are moved to the front of the list. Example: I’m assuming I can use a lambda in streams.sorted() for this but I’m not able to figure out what this would look like. Answer You can compare the bo…