Questions tagged as 'orm'

1
answer

How to pair two queries using Django Filter

I was breaking my head to make union of two queries using Django Filter and ended up doing it on the same hand ( Model.objects.raw("SELECT....") ). How could I do union with Django's ORM? Note: I have 2 different tabl...
asked by 14.12.2017 / 21:44
0
answers

How to create a custom model field inheriting ForeignKey in Django?

I want to build a custom field model that behaves like ForeignKey, but with some additional details. This custom field will automatically register a document, passing the model name as a reference. Therefore, if I am registering a person, a d...
asked by 25.11.2015 / 19:18
1
answer

Persistence with Doctrine does not take data from the object to the insert

I started a new project in PHP where every database is with tables and their columns with different names of classes and their attributes. With the intention of gaining in the productivity of not being renamed I decided to apply Doctrine ORM...
asked by 20.11.2015 / 21:14
1
answer

Doctrine 2 - Does not recognize class mapped with $ entityManager-getRepository ()

I'm going to be a little ... In my bootstrap.php file I'm trying to get the repository of a given entity and gives Fatal Error , stating that the Class does not exist, but it exists. Here is the error message: Fatal error: Uncaugh...
asked by 02.07.2014 / 14:39
1
answer

Sugar ORM ANDROID

Good morning Is there any way to change tables and fields in the Sugar ORM database, so that when performing the app update, it does not crash? I have a registration and I have the PRODUCTS table and it contains name, code, location, etc ....
asked by 29.10.2015 / 13:10
1
answer

Return records from a table whose key is referenced in another CakePHP 3

I'm using the ORP native CakePHP 3 to retrieve the records of the product table (through the ID) along with the records that reference it with the following method: / p> public function view($id) { if($this->request->is('get'))...
asked by 06.08.2015 / 15:04
1
answer

Model Layer with DAO classes

I work with an MVC application that can be considered large or at least average, since it involves hundreds of functionalities and more than 400 MySQL database tables. As an ORM tool we adopt Doctrine through dependency injection, and we choose...
asked by 06.11.2014 / 11:48
1
answer

Map columns of separate tables in a single object and vice versa

   Situation 1 I have the following very simple tables: ....................... And I have the following classes: Client: @Entity public class Cliente implements Serializable { private static final long serialVersionUID = 7...
asked by 03.07.2014 / 21:50
1
answer

Inserting data with PHP OO (Similar to EntityManager.persist (Object) java manager)

I would like a hint of how to loop to insert an object into the mysql / postgres database ... Example class User { // PRIMARY KEY public $id; public $login; // PRIMARY FOIREIGN KEY public $people; __construc...
asked by 11.06.2014 / 14:16
0
answers

Is it wrong for each attribute in a table to be a foreign key in another table pointing to it?

I'm doing a stock system and in modeling, instead of each item having its attributes defined I wanted to make four tables tags (tag_decimal, tag_data, tag_text, tag_booleano) that pointed to the table item.  As I've never seen this in my clas...
asked by 09.04.2018 / 16:29