relations

Doctrine: sort field in relations table (one to many), how to insert the sort number?

I have two tables, content and images (and a ContentImages table for the one to many relation, so that's actually 3 tables). The following code saves the relation (in the action > updateContentFromRequest() ): $ids = $this->getRequestParameter('contentImages'); if( isset($ids) ){ $ImagesTable = Doctrine::getTable('Content')->getR...

php doctrine relational form naming for saving data

is it possible to have an html form organized/named in such a way that $foo->fromArray($_POST) would actually save relational data as well? example: html_form_fields: user_name country_name db_table_users: id user_name db_table_countries: id country_name update: forgot to say i'm trying to make this with zend framework forms ...

Non Working Relationship

Hello everyone, I got a problem with cake's model architecture. I got a Users-Model and a Metas-Model. Here are the model codes: Users: <?php class User extends AppModel { var $name = 'User'; var $validate = array( 'username' => array('notempty'), 'email' => array('email'), 'password' => array('notempty') ); var $dis...

JPA joined column allow every value...

I'm testing JPA, in a simple case File/FileVersions tables (Master/Details), with OneToMany relation, I have this problem: in FileVersions table, the field "file_id" (responsable for the relation with File table) accepts every values, not only values from File table. How can I use the JPA mapping to limit the input in FileVersion.file_i...

django model relation definition

Hello, Let say I have 3 models: A, B and C with the following relations. A can have many B and many C. B can have many C Is the following correct: class A(models.Model): ... class B(models.Model): ... a = models.ForeignKey(A) class C(models.Model): ... a = models.ForeignKey(A) b = models.ForeignKey(B) Or is there a m...

JPA Inheritance and Relations - Clarification question

Here the scenario: I have a unidirectional 1:N Relation from Person Entity to Address Entity. And a bidirectional 1:N Relation from User Entity to Vehicle Entity. Here is the Address class: @Entity public class Address implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = Gene...

How to get Hibernate object relations dynamically?

Hi, I'm using Hibernate and I need to find a way of retrieving the relations for an object dynamically at run-time. I can't find this in the API. Can anyone point me in the right direction please? Thanks ...

Work with relations in Subsonic

Hi, I am using subsonic 3.0.3(ActiveRecords) in my winforms project. I am trying very hard to use Collections for my entities but so far I have been unable to do that . Please allow me to make myself more clear. While going across many tutorials, I have seen, that Subsonic will generate two classes. One is a collection class and the...

jQuery plugin to populate form controls from a JSON response?

Is there any plugin to populate any form control from JSON data with one command? I have a form with many selects, checkboxes and radiobuttons in it. Almost all controls depend on each other (many dependencies). Which way will be the shortest to describe all relations with controls? Example: Form to choose travel package contains contr...

How to use an auto incremented primary key as a foreign key as well?

Hello This is what I'm trying to do: I have 2 tables... CREATE TABLE `parent` ( `id` int(11) NOT NULL AUTO_INCREMENT, `data` text, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; CREATE TABLE `child` ( `parent_id` int(11) DEFAULT NULL, `related_ids` int(11) DEFAULT NULL, KEY `parent_id` (`parent_i...

merge findManyToManyRowset to third join in $select argument

Hi, How can i use findManyToManyRowset API while join to another table for info table of $matchTable? I can't find any way to pass a select object with desire join configuration to findManyToManyRowset API! Use case Example: Users Table | Departments Table | Users_Department Table | User_Profiles I want to use findManyToManyRowset m...

Relations between classes

I have four classes: Employee - contains only fields that hold informations about particular employee EmployeeGroup - contains only fields which describe type of jobs employee can do, each employee belongs to one of the EmployeeGroup classes. EmployeeDBase - contains methods for adding or getting employee and employeegroup from datab...

Django GenericManyToMany ?

Hi all! I want to make my Book model belongs to multiple Libraries, Collections, References and Editors, together. Is it possible to do it with generic relations ? Like that : content_type = generic.GenericManyToMany(ContentType) Thanks. from django.conf import settings from django.contrib.contenttypes import generic from django.con...

How to give 3 relations to same table in Cakephp

Hi i am new in cake php and can't solve the problem. The problem is I have a table like; id varchar(16) parent_id varchar(16) text text user_id bigint(20) is_deleted_by_user bit(1) is_deleted_by_us bit(1) who_deleted bigint(20) who_answ...

ASP MVC Delete only the relation between 2 tables (many-to-many relation)

Using ASP MVC with active record. Ive got 2 tables with records that sometimes are related and sometimes aren't. The relation is defined by the user. 1 table has projects, the other has devices. Projects can be created and deleted, devices cannot. When a user deletes a project, all relations between that project and the devices should b...