Most voted "orm" questions
Object-Relational Mapping (ORM) or object-relational mapping is a technique of mapping between object-oriented systems and relational databases.
Learn more…93 questions
Sort by count of
-
1
votes0
answers144
viewsRelationship Activerecord PHP
I have two tables, requests and half-payment on the table pedidos have the Foreign key meio_pagamento_id, how I define their relationship through activerecord php? I tried to: Class Meiopagamento…
-
1
votes0
answers75
viewsIs it wrong that each attribute of a table is a foreign key in another table pointing to it?
I’m making a stock system and modeling, instead of each item having its attributes defined I wanted to make four tables tags (tag_decimal, tag_data, tag_text, tag_boolean) that pointed to the item…
-
1
votes1
answer214
viewsDifferent Model type objects mapped from a single table
It is possible to map from a single table of the database different objects of type Model with Activerecord in a Ruby on Rails project? Suppose I have in the database a table with the name customers…
-
1
votes0
answers94
viewsHow to initialize Hibernate with Reflection
Hello, I need to initialize a list using Hibernate.initialize(list) within a Generic DAO. User Model @Entity public class Usuario { @Expose @ManyToMany(cascade = {CascadeType.PERSIST,…
-
1
votes1
answer616
viewsMigrations Hasmaxlength x Hascolumntype
I am creating a simple test table with EF Core e SQlite Follow the first test in which the modelbuilder creates a migration (shown just below) protected override void OnModelCreating(ModelBuilder…
-
1
votes0
answers29
viewsMediator vs CQRS vs Repository
Hello, I’m developing a migration to a new ORM, in . NET, from an application with a complex SQL database, many small tables between them. A very tight system. In order to better organize the…
-
1
votes1
answer292
viewsCode First Relationship Migration and Insert?
I’m using UserManager to manage users, I am using migration and I’m having relationship trouble. I happen to have the entity Cliente: public class Cliente : IdentityUser { [NotMapped] public string…
-
1
votes1
answer111
viewsHow to reconcile good Object Orientation practices and ORM frameworks for getters and setters?
In many of the systems I have worked on or had contact with, the class representing a model is usually a POJO, which we map your attributes for columns (for relational banks) or attributes (for some…
-
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
votes0
answers77
viewsValidation multi-company mysql relationship
Problem: a company can associate records that are not hers, just informing the id in the relationship Setting: My API is multi-company and each company manages its records (products, orders ...),…
-
1
votes1
answer66
viewsDisplay the input id data?
I have the method responsible for calling a page (View) which displays the data referring to the last id entered in the database and I am using the framework Laravel and ORM Eloquent public function…
-
0
votes1
answer851
viewsUpdating edmx file is not working
Whenever I do: UPDATE MODEL FROM DATABASE on top of my edmx file, it does everything right, including shows the table to be updated or the fields. It doesn’t make any mistakes, it acts as if…
-
0
votes1
answer473
viewsRelationship in the Doctrine
I have a problem that is analogous to the following situation: A car may or may not have a driver, or a car may have at least 0 and at most 1 driver. A driver may or may not have a car, ie a driver…
-
0
votes0
answers125
viewsRemove() from Entity Framework 6 only works when recreating the connection
I am creating an EF6 application and I came across a problem. I am using the concept of repository and when I run a delete (context.remove(obj)) and after that I reload the list and datagrid, I…
-
0
votes1
answer55
viewsRelationship between ORM tables
I have a doubt, regarding ORM, I use the Doctrine, but understanding of ORM would already help. The relationship of the idAninal table consulta, with the table Animal, would be, ManyToMany,…
-
0
votes0
answers129
viewsAPI in existing system database
I am with a doubt, in our company we have a system, developed in Mysql and Delphi, this system is developed by a company, and we are with several development projects, several new systems (created…
-
0
votes1
answer24
viewsCakephp 3 - Problem with Nested Eager Loading
I have the following table structure: Users Tools Groups All of them have membership from Many to Many And I already own the pivot Tables: groups_tools groups_users tools_users I am trying to do the…
-
0
votes1
answer381
viewsWorking with multiple databases from the same class model
I am new in Python and I need to implement a solution that every system user should have a separate database, briefly what I need is something like db1 = Persistencia('mysql',…
-
0
votes0
answers82
viewsReference of forein key, with the Entity Framework
I’m having a hard time making one Insert, because the FE indicates that there is error in the table reference. But, in my config, I state what is the foreing key. My config: public class…
-
0
votes0
answers35
viewsDoubt on converting SQL to Django ORM
Hello! I am studying starting in Django ORM and would like help to convert the SQL below as I am not able to perform the necessary junctions. Follows: SELECT P.nome, T.nome FROM professor as D INNER…
-
0
votes0
answers301
viewsJPA References an Unknown Entity
I have the following scenario: Class Rpsv3vo: package nfse.vo; import java.io.Serializable; import java.util.Objects; import javax.persistence.CascadeType; import javax.persistence.Column; import…
-
0
votes1
answer83
viewsIt’s making a mistake when I try to do the ORM
I created a table but when I run the application more than once it gives this problem. Why does this happen? environments { development{ dataSource { dbCreate = "update" // one of 'create',…
-
0
votes1
answer30
views -
0
votes2
answers75
viewsHow to pass an Array to the IN clause of a flat query?
I am using Activerecord to run queries in several different databases. In one of the queries, I have to do the following: publications_to_read = [1,2,3,4]…
-
0
votes0
answers249
viewsAre Getters and Setters automatically generated by Eloquent when we use reliese/Standard to generate Modules?
I have an application already functional. I am switching to Laravel 5.4. Since the database already exists and with actual data, my choice is not to use Migrations. One option would be to use the…
-
0
votes1
answer598
viewsHow to create entities with composite key in Doctrine?
I have a database that works with composite keys, and I am implementing the use of laravel framework. This is my bank’s structure: I’m using the Doctrine as ORM and discovered that I can not…
-
0
votes0
answers28
viewsBest way to build a class to run an SQL package
I am building a layer of access to the database and I need to access the functions inside a package on the oracle server. Orm already connects to the database and accesses tables and procedures…
-
0
votes1
answer43
viewsHow to catch daughter entities from a data constraint?
Well my problem is this, I need to bring a bank entity and it contains several lists that should bring your data following a rule, the field data_exclusao must be void. All entities have the field…
-
0
votes0
answers436
viewsNhibernate error: No persister for
I would like some help regarding the error presented when I try to record records with Nhibernate by XML mapping. The project has separate layers. In the domain project, is my entity: namespace…
-
0
votes1
answer19
viewsEloquent ORM Manytomany error of Constraint 1452
I’m developing an application using the Eloquent ORM, but I’m having trouble with the N to N relation, This is the relationship: The records I’m using as a test in the Product table: The records I…
-
0
votes0
answers106
viewsDapper in 1-1 grating where in class there is no foreign key
When working with ORM it is common (Will it be mandatory?) to create the model classes as if they were a mirror of the tables of the bank. But I have a different case and I was wondering if Dapper…
-
0
votes1
answer118
viewsAttributeerror- Sqlalchemy Flask
'str' Object has no attribute 'contains' I am trying to create a query using Flask-Sqlalchemy Flask should return me a list of books according to the user’s search. It selects 4 search options and…
-
0
votes2
answers115
viewsHow to return attribute value X - in a Manytomanyfield
I have some classes that relate to each other. Ex: I have an Activity class that has a M2m relationship with an Activity class. And I have another structure class that has a 1to1 with…
-
0
votes1
answer56
viewsDjango Filter ignoring characters/symbols
Problem Users who register with the email in gmail can create multiple accounts just by changing the . (dot) place. For example: [email protected] and [email protected] direct to the…
-
0
votes1
answer101
viewsUpdate all Fields of a model, except the key Primary
I am starting the studies in DRF and during a test I came across the following situation: it would be possible to change the fields of a class with the exception of primary key? My first attempt was…
-
0
votes1
answer693
viewsFilter and Join with Django ORM
I have 2 tables, one called Formsitems and another called Formstypes. Formsitems has an FK for Formstypes where the type of field that item is indicated. Using SQL I managed to make a Join between…
-
0
votes1
answer138
viewsHow to filter records per month in Python / Flask
Hey, guys. All right? I started learning programming some time ago and took advantage of this quarantine to give a gas and manage to create my first system - a voucher/advance manager. It’s simple,…
-
0
votes1
answer63
viewsPerform OR operation between two models in Sequelize
In my Proposal table I have two Foreign Keys that reference the same table(Producer), I need to make a Where to check if there is a producer with a document equal to the searched in one of these…
-
0
votes1
answer81
viewsLaravel returns empty attributes in Edit method
I have another similar route working perfect, I do not know what I missed.. I thank anyone who can help me. Route: Route::get('/itensnfe/{itemnfe}/edit',…
-
0
votes1
answer72
viewsFailed to parse time no eloquent
I have the following code: select('id','title', 'description', 'author', DB::raw("DATE_FORMAT(created_at,'%d/%m/%Y') AS created_at"))->get(); when I run it returns me the following error: erro":…
-
0
votes0
answers32
viewsError relating tables in Sqlalchemy
I have two classes mapped: User and Contact with one-to-many relationship (User.). from sqlalchemy import Column, ForeignKey, Integer, String, UniqueConstraint from sqlalchemy.orm import…
-
-1
votes1
answer1002
viewsHow to make a relationship with two items from the same table in Sequelize?
I have a table that holds two user Ids. The UserId and the ResponsibleId, both take from the table User. Model: module.exports = (sequelize, DataTypes) => { const Table = sequelize.define(…
-
-1
votes1
answer263
viewsInheritance with Typeorm
There are common problems that I see a lot of difficulty to deal with Orms, and ignoring a native way I decided to ask what is the best way to deal with these using Typeorm in project. Today I have…