I am using Fluent and NHibernate.
I have two objects say A & B which has a many-to-many relationship between them.
I am using a unidirectional many-to-many mapping when A HasMany B's. There is no reference in B about A (Unidirectional).
This creates a third table (named ABMapping) in the Database which has the two columns relating to pr...
I have four tables: Customer, CustomerCategory, Limit, and LimitCategory. A customer can be in multiple categories and a limit can also have multiple categories. I need to write a query that will return the customer name and limit amount where ALL the customers categories match ALL the limit categories.
I'm guessing it would be simila...
Hi!
How can I delete a child from a bidirectional many-to-many association?
Deleting the child does not work because I get an exception (FK Violation).
Just removing the child from the parent and call saveorupdate on the parent does not do anything.
Entities:
public class Employee : Entity
{
public virtual string LastName { get...
I have a 3 tables which are "News", "Tags", "News_Tags" with Many-To-Many relationship.
With the following mapping the "News" and "Tags" table have been updating, but "News_Tags" has not been updated.
Can anyone help me?
News:
<class name="News" table="News" lazy="false">
<id name="NewsID">
<generator class="identity" />
</i...
I have a Rotation class, which contains references to multiple lists of Advert objects. I would prefer an implementation where Rotation has a property of type List<List<Advert>> to hold these, but I am unable to come up with an NHibernate mapping supporting this.
In the database schema, the many-to-many relation between Rotation and Adv...
I constructed a Many-to-Many association between Users and Roles.
When a non-administrator logs in, I have hidden the Edit Role function, using
using the following code:
view/users/edit.html.erb
<%= error_messages_for :user %>
<% form_for @user do |f| -%>
<p><label for="login">Login</label><br/>
<%= f.text_field :login %></p>
...
Hello,
I'm trying to add an object to a collection in my client view and to save it on server with hibernate/jpa mechanism.
Here is the problem:
Take a Group object which can contains Account objects.
On my client view (gwt), I create a new group (so the id is null) and I add to this group some accounts (where ids exist). BUT these ac...
Hello
Nhibernate users, professionals, gurus and developers are expected. Please help !!!
I want to realise a n:m relation between two classes. A student attends in more courses and a course consists of more students as members. I do a bidirectional association many-to-many with bag to get the both lists from each site.
The two Studen...
I'm doing a small relational database, to be used by one person on a single computer. I chose OpenOffice.org's Base (version 3.1.1) because it's free and should be more than enough for this case. The simplified version of my problem is:
I have an Articles table, with columns: ID, Title, Content, etc....
I have a Keywords table with colu...
I have created a web app in MVC following the NerdDinner tutorial. I have 2 fields that have many to many relationship with my "dinner". For each "dinner", I need to be able to select one or more Companies from a Company table and one or more Services from a Service table. I've been reading blogs and forums for 2 days, but can't seem ...
A many-to-many relationship.
The tables:
Product (productId, ...)
Category (categoryId, ...)
Product_Category(productId, categoryId)
I setup the relationship so all updates will be done via the Product entity.
Product Entity:
private Set<Category> categories = new HashSet<Category>();
public void AddCategory(Category catego...
I have some database tables named "Project", "Employee" and "Branch". An employee can work simultaneously on more than one project. Similarly, in a project, there are multiple employees. Also, a project is conducted at a particular branch. To maintain all these relationships, I am using a "project_employee_branch" table, which will store...
I have two tables:
CalendarEntry
Id
Date
...
Holiday
Id
Date
...
In my CalendarEntry class, I have a property like this
public ISet<Holiday> Holidays { ... }
which I want to associate to the Holiday instances that occur on the same Date as the CalendarEntry. However, I can't come up with how to do this.
I've tried ma...
Hi
First off I'm using .Net 3.5 SP1. I have a few entities related as follows.
An Engineer has many Appointments
An Appointment has many Engineers
A Timeslot has many Appointments
I'm providing functionality in my data access layer to undo/discard changes made to entities. I'm doing this by calling...
ObjectContext.Refresh(RefreshMod...
OK, so the relationship is: Program has many :events
And each Event belongs to an Organizer (who has_many :events)
In a form for Program/edit, I'd like to list the associated events, and with each of those entries, also have access to each Organizer so I can do something like:
textfield(event.name) | textfield(event.date) | label(event...
I have four tables: Disks, Folders, Files and Links. It is four types of entities, and they can not be merged into one type (e.g. into one table) because they have different number and types of attributes. And there are relationships:
Disks can contain Folders, Files and Links;
Folders can contain Folders, Files and Links too;
Files an...
I currently have these models:
class Category(models.Model):
name = models.CharField(max_length=200)
parent = models.ForeignKey('self', blank=True, null=True, related_name='child')
description = models.TextField(blank=True,null=True)
class Item(models.Model):
name = models.CharField(max_length=500)
...
tag = mod...
I use these two entities to create a new user and groups it associates:
@Entity
@Table(name="usertable")
@SuppressWarnings("serial")
@Searchable
public class User implements Serializable {
@GeneratedValue(generator="userIdSeq")
@SequenceGenerator(name="userIdSeq", sequenceName="usertable_id_seq")
@Searcha...
I have two tables "Station" and "Route". Route can contain many stations and every station can be a part of the different routes. The logical solution is to create a table with 'station_id' and 'route_id' fields and there are lot of examples on the internet how to organize all of this stuff with hibernate. But I need to store the order n...
I've got a model called Card which has a ManyToMany relationship to
Tag. When I save a Card, I'd like to create a Product as well, which I
want to have the same ManyToMany relationship to tag.
How do I access the instance's tags? self.tags.all() gives an empty
list, while if I check after saving, the card actually has tags. My
code...