in this answer, the author said: Take an example of two entities mapped without declaring a owning side: From a OO point of view this mapping defines not one bi-directional relation, but two separate uni-directional relations. 1.My first question is: Why it is not a bi-directional relation? Docs Oracle: In a …
Tag: database
What is difference between transient state and removed state in JPA?
I have a question about entity states in JPA. I’ve read some article about entity states in jpa and my understanding about them is that: a transient object is a newly created object that hasn’t been associated with Persistence Context and does not represent a record in database. and when we remove an ob…
How to prevent saving empty data in SQLite database
I dont want to save empty data in my Note App. I have tried Everything but when I leave Edittexts empty it still saves data into my data base. what should I do? this is my insertNote method and this is the method that saves my notes in my AddNoteActivity i have also tried this but this is but this
How to save data from RecyclerView EditText
I have RecyclerView with multiple EditText. I want to save data that user provided to the EditText, store it and retrieve it after opening an app again. I have an app where user tracks how many repetitions of certain exercise they did and obviously I want it to be saved somehow and to be retrieved later, but …
How to generate .dot file using Schemacrawler
Using schemcrawler I’ve generated html file But I want to have an output in .dot file that contains diagram, node, graph, edge etc.. So how can I do it using my code or maybe some another way to do it with Java? Answer Simply change the output format from TextOutputFormat.html to DiagramOutputFormat.scd…
Working with multiple parameters in CriteriaBuilder
I have a need to use JpaSpecificationExecutor. Initially, I assumed that one parameter would be given as input and I would process it like this: CarRepository : However, I need to be able to work with: And in response to me came all the options for suitable machines. For example input: At the output, I want t…
How to load a different database file with Room?
Goal I have an app with plenty of data, with a switch button, which switch the language (french or english) of the entire app. However, some of my data are stored in a Room database. I have two .db files : database_fr.db and database_en.db. Let’s say the app is currently in french, with the database_fr.…
Create a table “ca” as a statement using values of another tables but while inserting new values, the values of “ca” doesn’t change
I want to calculate turnover like in new table called ca ‘ I have tables article (idarticle, priceBuying, priceSale, quantity), and table command have (idarticle, quantity, dateSale), I want to calculate turnover automatically everyday and insert into ca , but the problem is when I insert new values int…
Understanding how to model UML Class/Database
I’m confused with designing a client software with database integration to what should be a member variable of the class or just a query to the database. Let me be specific with a trivial example: If I have, lets say, a Student class, which has a list of “friends” that are Student objects. S…
How can you find out from spring cloud function that the connection you established to the database is closed?
In a spring cloud function usage, you don’t want your database connection to keep existing in the database. Once the spring cloud function finishes its process, is the following way to close the function appropriate? How do we validate if the spring cloud function inherently closes the connection even i…