Questions tagged [dao]

A Data Access Object (DAO), is a design pattern in object-oriented software design, creating an object that provides an abstract interface to some type of database or other persistence mechanism.

A data access object (DAO) is an object that provides an abstract interface to some type of database or persistence mechanism, providing some specific operations without exposing details of the database. It provides a mapping from application calls to the persistence layer.

Source: Wikipedia (retrieved version)

More details: - Core J2EE Patterns - Data Access Object

2621 questions
0
votes
0 answers

Adding new columns with non null constraints in new tables to an existing schema

Is it safe to add non-nullable columns in new tables of the schema in oracle? Assuming that I want to preserve old data when migrating. I have a database and a service that reads and writes from it. In the service, I have two dao classes (mappers),…
JavaGeek
  • 335
  • 1
  • 2
  • 11
0
votes
1 answer

Android - Get a single object from SQLite using Room

I am working on my first app where I can add, edit, delete,... objects in a SQ Lite database. This all works fine so far. Also loading all stored objects with LiveData works fine. Can anybody advice me, how the code in the repository should look…
Zudy
  • 49
  • 7
0
votes
2 answers

I am getting an error in Kapt Debug Kotlin. I have update versions of dependencies in gradle file. still facing this issue

My app was running smoothly but I am getting this error now.I am getting an error in Kapt Debug Kotlin. I have update versions of dependencies in gradle file. still facing this issue. How it can be resolved? I saw somewhere to see your room database…
0
votes
1 answer

Not being able to update JCombobox after adding an item in the list

I'm new to Java and POO so I'm struggling this proyect small proyect I have to hand in to the Univ. My main issue is that I using an atributte from an arraylist to populate the JComboBox, but when I add another object to that list in the other panel…
SantGlez
  • 1
  • 1
0
votes
1 answer

How to create relationship between two objects where primary key insert is OFF?

I have 4 tables, IndividualTruck, TruckModel, TruckFeature and TruckFeatureAssociation. IndividualTruck has a property TruckModel of Type TruckModel. After assigning other properties retrieved from a WPF form, I create the relationship and add these…
BoogieMan
  • 71
  • 1
  • 1
  • 6
0
votes
2 answers

how to check if an item with same name exists using dao,hibernate

In a web app,I am letting the user create an Item.The db manipulations are done through dao implementations which use hibernate.The generic dao implementation uses Criteria for the query The name of an Item is unique.So,I have to prevent a user…
jimgardener
  • 637
  • 2
  • 10
  • 26
0
votes
1 answer

Error creating bean with name 'activityController'

I'm having this problem while running on Server (Tomcat) my project. I have created a Maven project using Spring. The Java version is Java 1.8. NO SPRING-BOOT! Error creating bean with name 'activityController': Unsatisfied dependency expressed…
0
votes
0 answers

Importing TypeScript Failed

Asked to make a laboratory and an import error occurred //dao.ts file import * as fs from "fs"; const file = fs.readFileSync("foo.txt", "utf8"); console.log(file); I write "node dao.ts" in console and i have error: import * as fs…
Timur
  • 1
0
votes
1 answer

Throwing custom exceptions in multi-layered spring project

I am trying to handle the use case where there's a violation for an unique field (for example, the username/mail), would it be correct to handle it like so? (I am using jdbcInsert on the dao layer) @Transactional @Override public User…
Delsh
  • 67
  • 9
0
votes
1 answer

Hibernate Generic DAO - Testing whether the SQL generated is correct

I have a DAO infrastructure as follows: StoreDao, CouponDao, PersonDao. All these extend from a GenericDao which has the bulk of the functionality(using Java Generics). kind of explained here -…
Sam
  • 99
  • 1
  • 2
  • 7
0
votes
2 answers

Error With ROOM Database in Android Kotlin

I am a beginner in android and I am trying to build an app that could fetch from an api but I am facing an error related to Dao , I also tried to read and understand the error but was unable to , please help me with my error , I am getting this…
0
votes
1 answer

When I run my app it's ok only at the firts time only

This is the code of my fragment, when i created a recyclerview, when i can see a list if I click on I can see detail in antoher page, but when I come back I can't see the list. @Override public void onViewCreated(@NonNull View view, @Nullable…
Martak39
  • 13
  • 2
0
votes
1 answer

Can I use @PreAuthorize in a simple class ( not a @Component)

I am trying to add control authorization in some methods using @PreAuthorize("hasRole('ADMIN')"). Methods belong to a simple class DaoImpl implementing an interface DAO, I add this @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled =…
mosab
  • 207
  • 1
  • 4
  • 13
0
votes
1 answer

Do we have any library to generate entity fields in a class from a table?

For generating setters and getters for multiple fields in a class, we have lombok. Similarly, do we have any framework or library to get columns from a table in db and generate it on an entity class? It would be really useful while working with…
Kiran Cyrus Ken
  • 379
  • 1
  • 3
  • 17
0
votes
1 answer

Got error org.hibernate.HibernateException: Errors in named queries: customers.amountDeposit, customers.amountWithdraw

I have a problem in named query got error org.hibernate.HibernateException: Errors in named queries: customers.amountDeposit, customers.amountWithdraw Here is my Namedqueries of deposit and withdrawal of amount and DAO implementation of…
1 2 3
99
100