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
2 answers

MS Access Table (and TableDef) Properties

A table in MS Access opened in Design View exposes several properties, as does the table's Property Sheet. Many of these properties are undocumented or documented only for other objects. The question is, to which object do these properties belong?…
ebsf
  • 121
  • 6
0
votes
1 answer

Merging two dataset

I have one "big" TOracleDataSet which I can't change 'cause it's using in many different parts of huge project. I want to add just one record to this dataset for using in another grid. The solve way I see it is create another one oracle data set…
kseen
  • 359
  • 8
  • 56
  • 104
0
votes
1 answer

Mocked dao returns false when saving an object

I am new to test driven development. I am trying to test if an object has been successfully saved into my db. My code so far: @ExtendWith(MockitoExtension.class) public class ParkingDataBaseIT { @Mock private TicketDAO mockTicketDAO; …
newenpoi
  • 1
  • 1
0
votes
1 answer

'MyMethod' in 'Dao_Impl' clashes with 'MyMethod + extends' in 'Dao'; both methods have same erasure, yet neither overrides the other

I wasnt getting any errors before. But today, i entered my project to edit and saw these errors. First one is on this line; public final class NoteDao_Impl implements NoteDao { // The error code is : Class 'NoteDao_Impl' must either be declared…
Ahmet Kaan
  • 27
  • 5
0
votes
3 answers

Room DAO keeps returning NULL

In room, I have a dao to something like this: @Dao interface FacultyDao { @Query("select * from faculty") fun getAll(): LiveData> ... } And inside the repository, I'm simply calling this method and logging it: class…
Maifee Ul Asad
  • 3,992
  • 6
  • 38
  • 86
0
votes
0 answers

Is it required to have concurrency control in the DAO class of the Web Application?

I have a simple web application built on Servlet and simple DAO classes to handle database (MySQL) operations. My servlet may receive multiple requests at the same time. How will the database handle multiple requests? Suppose I have an "item"…
MFH
  • 357
  • 3
  • 17
0
votes
0 answers

problem when i update a recordset (access)

i try to update multiple records in a table using the subsequent code when I press the button, the code runs perfectly and updates the records. the funny think happens when i close the form. Then, the first record of the table changes. Probably, i…
Yannis
  • 1
  • 1
0
votes
0 answers

How to create DAO database access object in nodejs mongodb project?

I want to create Database layer and I am confused how to create / start with it. The database layer mainly contains this three files for instance The database model layer where user's model resides The BaseModel/layer where all the instances…
Digen
  • 67
  • 9
0
votes
1 answer

Room database - Dao - Repository - ViewModel

Writing good code between Dao - Repository - ViewModel. The function always return null value. from Entity: @Entity(tableName = "diabete") class Diabete( @PrimaryKey(autoGenerate = true) @NonNull @ColumnInfo(name = "diabeteId") var id:…
0
votes
1 answer

Why is the primary key not reset in android room?

private fun savetosqlite(CoinListesi: List){ launch{ val dao = CoinInfoDatabase(getApplication()).CoinDao() dao.deleteAll() val uuidList= dao.insertAll(*CoinListesi.toTypedArray()) …
Arafin
  • 37
  • 6
0
votes
1 answer

NullPointerException on MAX value retrieval from Dao in Room database

From the Room database, I want to get the MAX value for a specific column returned as a Long value, but it throws the NullPointerException error below when I add the very first item into the shopping list. How can I fix…
Raj Narayanan
  • 2,443
  • 4
  • 24
  • 43
0
votes
0 answers

Room Dao error: SQL error or missing database (no such table)

I have a requirement for two different Room tables with the same ShoppingListItem Entity. So, I recreated another Entity data class model with the same properties but with a different name, CustomSortShoppingListItemEntity. But, Room throws the…
Raj Narayanan
  • 2,443
  • 4
  • 24
  • 43
0
votes
1 answer

Cannot access database on the main thread since it may potentially lock the UI for a long period of time

My coroutine not working even I have done everything declared in Android Guide. What's wrong with my code? Logcat D/FATAL EXCEPTION LOGCAT: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the…
0
votes
0 answers

How to implement database to BroadcastReceiver (Alarm)

I'm making a app, that will notificate when time of task expiring. For creating notifications I'm using BroadcastReceiver. There is my code of class AlarmReceiver class AlarmReceiver: BroadcastReceiver() { override fun onReceive(context:…
0
votes
0 answers

AfterUpdate() Recordset edit leads to "No current Record 3021"

I'm using a form to enter a component ID (CID). After entering the Number in the Field I use the AfterUpdate() function with CID to look up a corresponding Prod ID in another Table. The Matching Prod ID from the other Table will then be entered…