Most voted "dao-pattern" questions
The DAO standard is a design pattern that abstracts and encapsulates the data access mechanisms by hiding the details of data origin execution.
Learn more…41 questions
Sort by count of
-
13
votes2
answers13163
viewsHow to make the Genericdao class using Hibernate?
I wanted to know how to make a generic Dao of a project, using Hibernate and JPA in java. All this to not be mounting a DAO as follows for each object that will persist in the bank: public class…
-
9
votes2
answers885
viewsDoubts about DAO, MVC, Multiple Tables and POJO
If anyone can help me, I have a question q has been consuming me a lot in recent days and is psychologically locking my studies (hehehehhe) MVC and DAO with multiple tables. I’m going to put here a…
-
7
votes1
answer764
viewsStructure/Organization Project C#
I have a project that I am developing in layers, so far I have the following: Access to data, presentation, business and transfer objects. The doubt is as follows: Example: I have one form to…
-
5
votes1
answer759
viewsPHP with DAO + mysqli
DAO necessarily needs to be a class? Or I could create methods within a file. php without encapsulation of a class? If not possible, what is the name of the classless DAO (name of some pattern equal…
-
3
votes1
answer539
viewsMVC and DAO standard
I have a layered system. I’m using MVC and inside the MODEL folder I have a DAO folder. Let’s assume I have a file called Professor_dao and another one called Aluno_dao. Question: Can I include the…
-
3
votes2
answers444
viewsMVC + DAO - Which way should I choose in PHP?
In Java, in the model class I can create in the class funcionario the attribute Setor s, but PHP is not typed, as I could solve this association case? After some searches here on the site, I saw…
-
3
votes1
answer376
viewsHow to adapt Hibernate to the DAO standard?
I’m starting to study Hibernate and wanted to "start the right way". The doubt is as follows: For any transaction I need to use the following code: Session session =…
-
3
votes0
answers64
viewsDatabase for Resumes
Good afternoon, I’m doing my TCC project for a HR system, only I have a question while storing resumes. In which there will be a form where the user registers his information, and if you want to add…
-
2
votes1
answer85
viewsTrack SQL output in Java
My java application for web gives several times the error of SQL Syntax, but only indicates a snippet of the SQL script that gives error. Is there any way I can see the full script that was "played"…
-
2
votes2
answers9661
viewsCRUD with MVC and DAO in PHP
I’m starting with programming and I’m doing a CRUD with MVC and DAO. I would like to know if the form I am doing is correct, what I could improve and how I call the insertion method of…
-
2
votes2
answers490
viewsOrganization of PHP code
I’m working on a PHP project where several tables relate to several tables, so how should I organize the controllers and Daos, split files by table - employees, sales, customers, ... or group by…
-
2
votes2
answers207
viewsPHP - Trait or Extended Class
Good afternoon, you guys, I have a trait that format data from Models in a MVC system, the system works correctly, however came to me a doubt in relation to Pattern design and performance, in case,…
-
2
votes3
answers561
viewsValidate if a CPF already exists in the List before inserting C#
Good evening, I am creating a sales system (college work) that has a simple registration of Clients (name and Cpf), we are working with the Project in layers, I am having difficulty because I am…
-
2
votes1
answer219
viewsHow to reference more than one ID attribute using the jpa API?
My question is whether I can use the annotation @ID several times in a row, if this is possible or if there is another way to reference attributes of the type ID after the first. import…
-
1
votes0
answers60
viewsDAO class recording in multiple tables
I have a model object Mensagem that has the attributes Tipo and Descricao, the information of this object must be saved in a database, so I created a DAO class responsible for inserting it in the…
-
1
votes1
answer719
viewsHow do I make a DAO standard abstract java class to inherit in dao classes?
I want to make an Abstract Class in Java to use in the Dao classes that I will use in several projects, not to repeat the methods of selection, insertion, deletion and update in all dao classes. I…
-
1
votes2
answers318
viewsDAO + Webservice
I want to use the DAO standard to create a Java project in Eclipse to view data from a database. Only I want to turn it into a Webservice.. How should I proceed? Just use that IDE Webservice…
-
1
votes1
answer133
viewsSave data to DB and recover ID automatically
This is the code to save to the bank using the default DAO, where I want to recover the id record to save the table Usuario who owns the FOREIGN KEY table Habilitacao: public int…
-
1
votes0
answers133
viewsHow to pass parameters for a query in a repository?
I’m creating a series of classes that return listings in Java (Android). I am concerned about the format of the parameters that will be passed. My initial approach has been to pass a Map with…
-
1
votes3
answers227
viewsWhat is the pattern represented by this class called?
I wonder what kind of class this is DaoDeAutenticacao, whose skeleton I wrote down. Despite the name I don’t think it’s a DAO (Data Access Object), however it is defined, and yes something else (a…
-
1
votes2
answers85
viewsJPA Hibernate with Postgres - 2 transactions
I started using Hibernate 1 month ago. I am developing a simple application from bank to college. I have an account class, which has the Withdraw Value method : public boolean SacarValor(long…
-
1
votes0
answers44
viewsHow to query database postgres from web java
I want to do a database search from my HTML page by typing the first letters (eg and%) and in the table should appear the list of words starting with the typed letter: My database is Postgresql.…
-
0
votes0
answers99
viewsError when returning the object after query
Good night to you all. Objective: The main objective is to take the user id and the code of the simulated that he answered, and display it on another screen after he answers this simulated, however,…
-
0
votes1
answer44
viewsHow to load database data to a jtable
At the time of execution appears the error message of this excerpt and I am not able to find the error. I know the connection to the bank is right because I have other classes in the same program…
-
0
votes1
answer390
viewsDynamic query using JPQL
I need to implement a dynamic query logic, in BD using JPQL, and I have 4 filters: 1 - PROJECT COORDINATOR 2 - SERVICE PROVIDER 3 - PROJECT START DATE 4 - FINAL DATE OF THE PROJECT Any of the fields…
-
0
votes1
answer117
viewsProblems with the DAO
My DAL class launched the Typeinitializationexception exception. How to correct? Follows the code public partial class FrmConvenio : Form { ConvenioDAO convenioDAO = new ConvenioDAO(); // Lança…
-
0
votes0
answers99
viewsRefactoring a database using VIEWS
I have the task of refactoring a database and would like to know if VIEWs are viable for the task. My strategy is to create a VIEW imitating the new structure of the supposed table, at least the…
-
0
votes1
answer53
viewsError showing SQL server Sum in DAO layer
I’m struggling to show the result of SUM in the DAO layer, the query brings the expected result, however, in the field where it is to show the sum, it does not show an error. The process in Sql…
-
0
votes1
answer489
viewsHow to Save the Date Field of a Java SE Application in Postgresql
I need to save these two dates (ALLOCATION DATE and RETURN DATE) from an allocation, where I have the following Allocation Table: CREATE TABLE public.aloca ( alocod serial NOT NULL, alodtdevolucao…
-
0
votes0
answers42
viewsRegistration N to N (many to many), where I need to send an Array according to the image
I am making a registration N for N (many for many), where I need to send according to the image an Array of medicines, Unit and posology. The question is how to take this Array in just one request…
-
0
votes1
answer295
viewsEnum returns null from the database
Hello, I’m implementing a DAO and doing some tests, I’m having some problems in enums. When running the test class the Enum Size returns null, but in the database I have records filled correctly.…
-
0
votes1
answer81
viewsDatabase connection object: Should I only have one for the whole system or one instance per class?
What is the best practice: to have only one point (Singleton) that returns the connections to the database or to create an instance of the connection for each object? My system accesses several…
-
0
votes3
answers245
viewsReturn a SELECT * FROM" in the Javaweb browser
Hello guys I am studying Javaweb and I came across a boring mistake!! I’ve done a lot of research on the subject but I couldn’t solve this mistake. I have this method that is pulling all data from…
-
0
votes2
answers370
viewsRun select from the java DAO class
I’m having trouble using a select of a dao class in a main class. You can help me. Follows code. package Model; public class MTotalProduto { private String codigoBarra; private double totalProduto;…
-
0
votes1
answer471
viewsError - java.util.Date cannot be cast to java.sql.Date when saving data
When trying to write the data to the database, the program points me to this Exception:java.lang.Classcastexception: java.util.Date cannot be cast to java.sql.Date. The first code slime is Servlet…
-
0
votes0
answers45
viewsDAO method returning attributes of more than one object
I have a question in the use of DAO. If I need to return a set of attributes of 2 objects? Let’s say I have a DAO category that has a method that in addition to the category attributes needs to…
-
-1
votes1
answer27
viewsAccessing method (beginner)
I started my studies recently and a question arose regarding the access of information of a method. I have an X.php file that has the following structure: public function…
-
-1
votes1
answer955
viewsTrying to get Property of non-object
I have this form: <form class="login" name="login" method="post" action="../controle/usuario-controle.php?op=logar"> <input class="input" type="text" name="txtlogin"…
-
-1
votes0
answers12
viewsJava Dao class showing the following error:The Resource type Connection does not implement java.lang.Autocloseable
The error is being presented where I perform Try try (Connection connection = getConnection(); And consequently, my Preparedstatement says that the Connection type is not visible in that line:…
-
-2
votes1
answer49
viewsHow to implement the DAO standard in subclasses?
I’m developing an app that’s a gun store. I own the class Produto with the subclasses Arma, Faca and Municao. In this project I am applying the DAO standard, but I don’t understand very well how its…
-
-4
votes1
answer119
viewsStructure of Java projects
I’m having doubts where I work, there are many projects with many different classes, and they use patterns that I didn’t learn in college. Patterns like: DTO, Canonico, Entity. Within these…