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
1 answer

Controller calling DAO bypassing Service

In a canonical Spring MVC implementation, the architecture goes something like this +--controller | | | +--MyController (@Controller, calling MyService) | +--service | | | +--MyService (interface) | +--MyServiceImpl (@Service, calls…
amphibient
  • 29,770
  • 54
  • 146
  • 240
0
votes
0 answers

Not able to set session factory through servlet.xml using Spring MVC and Hibernate 5

I want to set session factory in DAO class but after execution I got this issue. In my class i am setting sessionFactory variable through @Autowired annotation but it is not able to set the session Factory. *************************** APPLICATION…
0
votes
1 answer

Android rooms get data from database

I have a table, that I also use as a junction. @Entity(tableName= "table_ref", primaryKeys = ["zutatid", "rezeptid"]) data class RefZutatRezept( val zutatid: Int, val rezeptid: Int, val menge: String ) I want to write a function in my…
Sonne
  • 45
  • 7
0
votes
0 answers

Property [uniquedataid] not found on type [com.luminajio.input.poststack.PoststackModel]

I am trying to display an arraylist in a JSP. I can query and display some of the elements in my model object, PoststackModel, but some of arraylist elements throw an error. In particular, I cannot display 'uniquedataid'. I do not understand why.…
ajkrueger
  • 13
  • 3
0
votes
1 answer

Transaction with room to update multiple rows doesn't update

I'm facing an issue with Room on Android. I have a DAO with multiple methods @Insert(onConflict = OnConflictStrategy.ABORT) suspend fun insertEntity(entity: Entity) @Update(onConflict = OnConflictStrategy.REPLACE) suspend fun…
JohnDoe
  • 1
  • 2
0
votes
1 answer

Jetbrains Exposed: Self-Referencing One-to-One Table as Well as Entity Declaration

Let's say we have an "Organization" table. The "Organization" has a foreign key pointing to another "Organization" row within the same table as its parent. In Jetbrains Exposed, the one-to-one self-referencing relationship can be declared as: object…
0
votes
2 answers

Parameter 0 of constructor in '' required a bean of type '' that could not be found

I am creating a spring boot application, and using doma for O/R mapper. I could not start application because repositoryimpl can not find dao class , but i can see them in the build/classes . so build is successful but the application fail to…
iioiia
  • 15
  • 5
0
votes
1 answer

Why use default access for methods in a generic DAO interface?

I found this code for a generic DAO interface while browsing around: public interface GenericDAO { Class getEntityClass(); T findById(final ID id); List findAll(); List findByExample(final T…
James P.
  • 19,313
  • 27
  • 97
  • 155
0
votes
0 answers

Implementing generic DAO interface, return type of class implementing it must be cast to type T? why

I am implementing a DAO for my first full stack java program and I am a bit confused when trying to implement this generic DAO interface. See below public interface IDataAccessDAO { List selectAll(); T selectSingle(int id); void…
Nooby1
  • 49
  • 1
  • 6
0
votes
1 answer

Read only recordset "local" update

I have DAO recordset that is generated with pass-through query to postgresql stored function. I use it to fill out combobox in my form. What I need is additional item in combobox with "AllItems" description. But the recordset is read-only (that's…
Smok
  • 101
  • 2
  • 11
0
votes
2 answers

How to access DAO enumeration constants in PowerShell?

In PowerShell, how do you access DAO enumeration constants, such as RecordsetTypeEnum dbOpenTable (1) or DataTypeEnum adVarNumeric (139)? Right now, I'm simply putting them in as magic numbers, but it would be much cleaner and easier to read to…
whairst
  • 43
  • 6
0
votes
0 answers

I'm trying to build a Kotlin application, but I get the error "Dao class must be annotated with @Dao"

I am trying to build a Kotlin manga application through Android Studio, but I get an error like I tried googling, but I could not find anything other than an article on SOF, if I understood correctly, this does not work for…
Zorome
  • 106
  • 8
0
votes
4 answers

DAO passthrough query using VBA: "Error 3131 Syntax error in from clause"

I copied a solution found in Stack Overflow, adapted it to my needs. Public Function getAssortmentTypes(Optional personId As Variant) As DAO.Recordset 'personId is integer Dim strQuery As String Dim qdf As DAO.QueryDef Dim rst As…
Smok
  • 101
  • 2
  • 11
0
votes
2 answers

Failed to convert from type (Java - Spring boot)

I have spring web app (JPA/Hibernate + MySQL). I have three classes. Top10 public class Top10 { @Id Product id; Product name; Integer soluong; } Product public class Product implements Serializable{ @Id …
sunsynd
  • 31
  • 6
0
votes
1 answer

Getting this error "Must have exactly 1 query in the value of @Query or @DatabaseView" in android studio project

I need some help. I am getting this error "Must have exactly 1 query in the value of @Query or @DatabaseView" in my android studio project when I build my project. I am getting this error in my cartdao.java file code is here: package…
Ayesha
  • 3
  • 2