The ProductCategoryDto class : CategoryAttribute class : The query with needs to be executed is The output for the query is Database create statements: Code generation configuration in pom.xml: I am getting all the boolean fields as null while they are not null in Actual data. How to map the boolean fields properly so that there will be no null
Tag: java
SQL Joins not working correctly when no data present
I’ve got the following code, where I build a tag from an entity Each tag has an id, name, description and how many questions it has, how many it has in a day, and how many it has in a week. The problem is, I can’t seem to display tags that have no questions tied to them, and also if
how to set concatenated string parameter in preparedstatement
I have the following java code: I get the following exception in codeline 3-: Invalid column index What did I do wrong? how to set params correctly? Answer Take the bind parameters out of the string literal: Or, create a single bind parameter and pass in the concatenated value:
Query did not return a unique result
This is the query I have written: This is the output I am getting from the database: id versions 101 0.0 101 1.0 101 2.0 101 3.0 In my application, I am storing this result in but it gives an error saying “query did not return a unique result” How can I store this result? which data structure could I
Spring boot and jpa query @P0
I’m trying to run the following query but I keep getting the syntax error @P0, I also tried not to use parameters but “?” and still not working, my guess is that the string is not placed under ” and it ends up just next to bulk, but as soon as I place the single quote I get the error
Create relationship between 2 tables JPA
Need help with setting up table relationships. So, there are 2 entities – Section and Period. 1 Section has many Period, but 1 Period do not belongs to any specific Section. I implemented this relationship as follows: created an additional table SectionCodes with an external key on Section (more in diagram) Section class: SectionPeriod: This works fine, but there is
Integrity constraint violation: unique constraint or index violation HSQLDB
For example if I add new Department(new BigInteger(“50”), “ODD”, “SPB”), all work, it values are insert into database. But if I want again insert for example new Department(new BigInteger(“50”), “ODDMOD”, “SPBMOD”), appear java.sql.SQLIntegrityConstraintViolationException: integrity constraint violation: unique constraint or index violation; SYS_PK_10092 table: DEPARTMENT. I know that can not insert values with the same primary key, but how can update
Java Sqlite how to print a.rowname
I asked myself how I print a.rowname in Java with jbdc sqlite. Or did I take the wrong solution to fetch all the Selected data? I tried this: And I get this error: In Python it works kind of like this. I can later just get the Selected data from the array: Answer You do not select a.spieler try: Update
Using the ‘astar’ function of OrientDB: an SQL call in Java
I’m using OrientDB to represent large city maps and calculate the shortest traversal times between a pair of nodes when the need arises. I have the following method: The getNode(nodeID) method returns the OVertex object present in the database, hence we can identify the @rid. Clearly, this method serves no purpose as is. My issue comes when trying to call
How can I filter composite ManyToMany POJOs by children POJO’s attributes?
I have two Room Entities like this ones: …and a junction table for Many To Many relationship like this one: …and some composite class for obtaining some kind of “composite POJO”: …then, I have this kind of “composite DAO”: The point of the question is… The one that works returns the list as expected: with each TeacherWithCourses having the Teacher