All Questions
Tagged with insert-update java
55
questions
0
votes
0
answers
19
views
Value of one field in one entity has been changed after hibernate call saveOrUpdate
One object has been sent to hibernate saveOrUpdate method for updating the data. Before save the value of one field was different and after save the value in the object got changed. Is this one of the ...
0
votes
1
answer
75
views
How can I insert data into a 1-n relation table in Spring Boot JPA without updating the User table?
User
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@Table(name = "user")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.UUID)
@Column(name = &...
0
votes
1
answer
762
views
ModelMapper DTO-->Entity. How to skip unconditionally all fields not mapped
I have two classes (entity and DTO)
public class Deliver {
private Long id;
private String uri;
private Instant moment;
private DeliverStatus status; // enum PENDING,ACCEPTED,...
0
votes
1
answer
362
views
How to change name of a field in MongoDB with java for each document in the collection?
Due to some decisions I will have to change the name of some fields in all documents in a single collection. For purpose of automation testing I am inserting documents and then checking some logics.
...
0
votes
1
answer
556
views
Hibernate batch update issue
For a simple batch update of a MariaDB table, properly mapped as a Hibernate entity class, a simple update via Hibernate produces the error
org.hibernate.StaleStateException: Batch update returned ...
0
votes
1
answer
775
views
Best strategy for Massive Insert/Update using jdbc in mssqlserver
Good Day, I posted this question previously but it seems I am not clear enough so I will try to be as detailed as possible here about my situation.
I need to implement a solution to do a daily ...
1
vote
1
answer
1k
views
Partial insert update of Hibernate JPA Model using the Repository Save or SaveAll methods without @Transient or @DynamicUpdate annotations in Model
I have my model
@Entity
public class Person{
@Id
@Column(name = "id")
String Id;
@Column(name = "name")
String name;
@Column(name = "location")
String location;
@Column(...
1
vote
1
answer
1k
views
"insert ignore" or "on duplicate key update" using @Query & @Modifying without using nativeQuery or save() or saveAndFlush() JPA Hibernate
My example is below:
Person is a simple Entity with 3 fields "Long id, String name, Integer age", and, maps to a corresponding Person table with 3 columns per above)
@Repository
public ...
1
vote
1
answer
3k
views
Is this a correct solution to the Spring Data JDBC problem of the insert/update? [duplicate]
PROBLEM:
when I tried to create a new entity 'Customer' with Spring Data JDBC (in a Spring-boot application)
@Data
public class Customer {
@Id
private String identifier;
private String ...
0
votes
0
answers
21
views
Java JDBC SQL rewriting one table to another [duplicate]
Hello I have table "players" and I try to rewrite my results from "players" to empty table "second_players". Now I have ony first result, but I want all results in my new table. How can I do it i ...
0
votes
1
answer
2k
views
Bulk insert from a csv to a table in an Oracle DB using Java
I am attempting to insert a table in an Oracle DB using java. I am reading a csv file line by line using OpenCSV. The csv is about 50000 rows and 9 columns. Here is some of my code:
/* ...
0
votes
0
answers
185
views
How do I update a folder with Google Drive API in Android?
I'm trying to use the Google Drive files.update method in Java to update a folder. By update, I mean replace all the contents with whatever the contents that the new folder has. This is the method I'm ...
1
vote
2
answers
155
views
How do I get my sql update method to work?
I am doing a method where it should update the location of a tag (card) I have in my local database, this method (UpdateWallet) takes the user's input and overwrite the record in my database according ...
0
votes
2
answers
4k
views
android.content.ActivityNotFoundException: Unable to find explicit activity class { have you declared this activity in your AndroidManifest.xml?
I'm having these error
android.content.ActivityNotFoundException: Unable to find explicit activity class {}; have you declared this activity in your AndroidManifest.xml?
at android.app....
0
votes
1
answer
41
views
Java Mongodb update Database Object
I work with upload data that is stored in one collection. The data contains information about the upload date as an integer value so I want to create one Object in the collection that holds all the ...