All Questions
Tagged with database design-patterns
11 questions
1
vote
1
answer
123
views
Database design using Closure Table for tagging system
I created these database tables with the inspiration in NjDevPro github repository. The design uses Closure Table for implementation of hierarchical tagging system in ...
1
vote
0
answers
176
views
Database connector in Python
I've been trying to build an ORM. I started with the connector layer, which is responsible for the database server connections and executes raw SQL as the code below shows.
I have built the ...
4
votes
2
answers
173
views
Image Database Service
I created simply database service with get, insert, get all image names and verify exist method.
All images will be store in blob storage with unique filename + postfix size. Next one I have image ...
3
votes
1
answer
215
views
Classical model for database connection provider
Let's forget about Spring Singleton Beans and about other frameworks in Java. We have one or more simple HttpServlets. And we should make database connection. (doesn't matter what is it, hibernate ...
4
votes
2
answers
206
views
DB-to-Java value mapper
In my company, I've inherited some Java library that I'm now writing tests to, refactoring and fixing Sonar issues.
One particular point that Sonar is complaining about is a big chaining of ...
3
votes
2
answers
18k
views
Simple singleton database connection pool
I'm studying design patterns, and to demonstrate a singleton, I've implemented a primitive database connection pool.
ConnectionPool.java
...
3
votes
1
answer
125
views
Mapping different classes to the same database table
I have several very similar subclasses that I (think I) want to be stored in the same database table. Most of the fields are identical, with each subclass adding 1 or 2 custom fields. My code is using ...
5
votes
4
answers
1k
views
Database adapters
I'm writing adapters for some MS Access database because I really didn't like that automatically generated code that Visual Studio was providing. Right now I just need to get data, not updating ...
10
votes
2
answers
16k
views
Manage connection without 'using' statement
I replace this common statement:
...
4
votes
3
answers
253
views
Cancelling an order with a side-effect of logging the operation
I have a data access layer method to cancel an order. This operation should have an associated "operation history" entry.
My first (naïve) implementation looks like this:
...
2
votes
1
answer
3k
views
Builder pattern for Codeigniter ActiveRecord queries
I am using Codeigniter and it's ActiveRecord.
I had this idea for a base class that provided a generic getter/setter for doing simple queries on a database. I have a lot of database objects that ...