Does someone have a good idea/solution how to achieve this?
Situation is:
I have the tables 'releases' and 'ntags',
related via 'releases_ntags' (containing 'release_id' and 'ntag_id')
And I would like to fetch results for releases via the ntag's 'slug'.
I manage to have this semi-working:
sql
SELECT r.id, r.name
FROM releases r
LE...
I have a class, BillMedicine, which is many-to-many table for Bill and Medicine.
The BillMedicine mapping file is:
<class name="BillMedicine" table="Bill_Medicine">
<composite-id>
<key-many-to-one name="Bill" class="Bill" column="BillID" />
<key-many-to-one name="Medicine" class="Medicine" column="MedicineID" />
...
Hi there,
I have these 2 objects in NHibernate forming a many to many relationship:
User:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Providers" namespace="Providers.Objects">
<class name="User" table="Users">
<id name="UserId" type="int">
<ge...
Are there any components or class libraries (.NET, Silverlight, Javascript) which are able to visualize / navigate data in a many-to-many relationship? Similarly as a Treeview is able to visualize / navigate parent-child related data.
I'm looking for a way to view some object and N levels of related objects.
...
Here is a snippet of how my models are setup:
class Profile(models.Model):
name = models.CharField(max_length=32)
accout = models.ManyToManyField(
'project.Account',
through='project.ProfileAccount'
)
def __unicode__(self)
return self.name
class Accounts(models.Model):
name = models.Ch...
I currently have a one main table with multiple other tables associated with it via many-to-many joins (with join tables). The application using this database needs to have search functionality that will print out multiple rows matching specific criteria, including all the values in the join tables. The values from the join tables also n...
Hello
I have modeled two classes with a many to many relationship : User and Conversation, and I can't create a the link between these two classes when I use them :
class User extends Doctrine_Record
{
public function setTableDefinition() {
$this->hasColumn('udid', 'string', 255);
$this->hasColumn('nb_requetes', 'integ...
Situation:
I have 3 tables: Student, Address, StudentAddressLink As follows Note* not EXACT yaml file but you get the idea
Student:
column:
id: blah blah
name: blah blah
Address:
column:
id: ~
street: ~
StudentAddressLink:
column:
id:~
student_id: ~
address_id: ~
relations:
Student:
...
I asked this question a while back without an answer, I believe it may be the most bizarre implementation for the EF, although it is quite practical. Here is my previous post:
http://stackoverflow.com/questions/2367702/entity-framework-self-referencing-hierarchical-many-to-many
I've decided to ask again with the additional keyword Payl...
I have a ManyToMany field with a relationship model. I want a formset, filtered on one of the
keys, which shows a form for each of the other keys.
My guess is that a custom manager on the relationship model is the key to solving this problem. The manager would return "phantom" instances initialized with the appropriate ForeignKey when n...
I am trying to delete an object that sometimes has a many-to-many relation. The code I use now is:
db.DeleteObject(registeredDevice);
db.SaveChanges();
This ofcourse just removes the registeredDevice. But usually this device has a many-to-many relation to a project in the database. When trying to delete the device in that scenario it...
Using the following related models (one blog entry can have multiple revisions):
class BlogEntryRevision(models.Model):
revisionNumber = models.IntegerField()
title = models.CharField(max_length = 120)
text = models.TextField()
[...]
class BlogEntry(models.Model):
revisions = models.ManyToManyField(BlogEntryRevision...
I have a project using Hibernate on an Oracle database for which all entities are generated directly from Hibernate Tools under control of a hibernate.reveng.xml file.
I have one class which has a many-to-many relationship to itself using an intermediary table, like so:
PERSON:
ID
...
PERSON_PERSON:
PARENT_ID --> PERSON.ID
CHI...
I have a database relationship that looks something like this:
booking -> person <-> option
-> : one-to-many
<-> : many-to-many
I now need to list all the persons in a booking, with all their options. Using ORM in kohana I can load all persons like this:
$persons = ORM::factory('booking', $id)->persons->find_all();
I could then l...
Hello,
I have a situation where I need to store a graph data structure in the database.
This means an entity can have unlimited number of related entities of the same type (related entity can have unlimited related entities as well).
I was thinking that many-to-many relationship would solve my problem.
I'm trying to do mapping with F...
Following regular manytomany queryset logic gives me errors. I guess since its related to self, I might need to do some extra magic, but i can't figure out what magic.
model:
class Entry(models.Model):
title = models.CharField(max_length=100, verbose_name='title')
related = models.ManyToManyField('self', related_name=...
I have a question which I think should be pretty common but I can't find an answer.
I have 2 objects: Group and User. My classes look something like this:
class Group
{
@ManyToMany(fetch = FetchType.EAGER)
List<User> users;
}
class User
{
@ManyToMany(fetch = FetchType.EAGER)
List<Group> groups;
}
Now, when I try to get a Use...
Hey,
I have two types of accounts (customer and provider), I chose the single-table strategy for persistence. Customer creates Orders (one2many) and provider bids on the orders in auction style (many2many relationship, because he can bid on many orders as well as other providers). My question is, is it possible to have these relationship...
I have an existing project with models (Users and Books). I would like to add a ManyToMany(M2M) field to the existing model Books, but the syncbb command does not do this.
Details: Books already has a FK field that maps to User, and I want to add a new M2M field (readers) that also maps to User. As you know, Django's syncdb only cares...
I'm using Fluent NHibernate to generate a database schema from .Net entity classes. I have two classes User and Permission with a many to many relationship, and Fluent NHibernate is correctly generating a junction table UsersToPermissions in the database.
As expected the junction table is storing the primary keys UserId and PermissionId...