Questions tagged [self-reference]

Self-reference is the ability of a program (or logical sentence) to refer to itself, either directly or indirectly.

Self-reference is the ability of a program (or logical sentence) to refer to itself, either directly or indirectly.

Useful Links:

Stanford Encyclopedia 'Self Reference' Entry

Related Tags:

596 questions
0
votes
1 answer

Itemclass with Listclass-parent as member in c++

I know, the title is confusing. But i didn't know any other way to forumlate it. The Problem is as follows: I have two classes. One is the Listclass and the other is the Itemclass. So the Listclass has a list (std::vector) of Itemobjects. But now…
user2706035
  • 95
  • 1
  • 1
  • 6
0
votes
2 answers

Symfony formbuilder self-reference entity grouped

I want a choice list (dropdown) grouped by parent categories (not selectable). Is this even possible? Example: - Vehiculs (not selectable) -- Car (selectable) -- Boat (selectable) - Computers (not selectable) Entity Category /** *…
Mathias Dewelde
  • 665
  • 9
  • 19
0
votes
1 answer

Rails 4 routes with single table inheritance and self references

I've been jumping between design patterns, firstly trying polymorphic, now landing on STI. The main goal is to implement a Server > Host > Guest model where a Server has Hosts, Hosts have Guests and each able to have Posts. Although not the main…
0
votes
1 answer

Edit of self referencing HABTM in cakephp works, sometimes

I'm using a self referencing HABTM model with Participants. You sign up for an event and when you log in to your reservation/profile you see a list of other participants and you can choose to add yourself and others into various groups; share hotel…
user230797
0
votes
0 answers

Grails - Hibernate mapping with self referenced table

I'm upgrade the grails version of my app from 1.3.7 to 2.2.4 and now a spiritual bug is haunting myself. If I take off the dateCreated property works fine. I try use the beforeInsert, but the problem is the same. I have a self referenced entity like…
jpozorio
  • 622
  • 6
  • 7
0
votes
1 answer

FutureTask with Callable that references the FutureTask

I have a situation where I need to create a FutureTask with a Callable that checks if it's owner has been cancelled. The code I have looks like this: public static FutureTask makeFuture(final Call call, final TaskCompletionCallback…
aliak
  • 428
  • 4
  • 12
0
votes
1 answer

Self referencing Entity in Hibernate with additional Columns

I wanna map these tables with Hibernate: CREATE TABLE user ( id VARCHAR(20), //some stuff PRIMARY KEY(id) ); CREATE TABLE friendship ( user1 VARCHAR(20), user2 VARCHAR(20), firstMeeting TIMESTAMP, //mb some…
0
votes
1 answer

Entity Framework self-referencing entity query results are flat AND hiearchical

I have a self-referencing entity: When I query this entity.. var query = this._context.DispositionPossibilities .Where(x => x.AreaID == areaID) .Where(x => x.IsActive == true); .. the resulting collection has EVERY item returned from the…
JoeBrockhaus
  • 2,745
  • 2
  • 40
  • 64
0
votes
2 answers

symfony2 self referencing entity has validation problems

I have an entity that can have another entity of the same type as parent (self-referencing?). So I have a container named Sweden, then another Container named Stockholm, and the $parent property of Stockholm is Sweden (these two are the same type of…
Matt Welander
  • 8,234
  • 24
  • 88
  • 138
0
votes
1 answer

Self-referensed entity to wpf treeview using Binding Converter and ObservableCollection

I have entity , build by default from the database table which references to itself I'm new here and low reputation not alows me to add images, so I'll write all I can. Area : EntityObject Properties: ID ParentArea_ID Navigation Properties: Areas -…
Dmitry
  • 21
  • 4
0
votes
1 answer

Core Data: migrating entities with self-referential properties

My Core Data model contains an entity, Shape, that has two self-referential relationships, which means four properties. One pair is a one-to-many relationship (Shape.containedBy <->> Shape.contains) and the another is a many-to-many relationship…
0
votes
1 answer

Best way to select from large self referencing table (HQL)

I have a large self-referencing table Items. Items have parent Items, something like so: ITEMS Long id String name String type Long parentId (fk. ref Items) The use is non-circular (so it's a representation of a tree, not a graph). Now, I need to…
0
votes
1 answer

C++ self referencing object and inheritance

I have a parent class which as a member contains an array of pointers to objects of the same type as itself. I have another class that derives from the parent class. I want that the derived class uses an array of pointers to objects of its own (not…
hlitz
  • 635
  • 6
  • 24
0
votes
2 answers

Add choice "self" to self-referential foreign key on Add form

I have a self-referential ForeignKey field: class Thing(models.Model) special_thing = models.ForeignKey( 'self', blank=True, null=True ) On the "Add Thing" form, in addition to other existing things I need to offer a…
Danny W. Adair
  • 12,498
  • 4
  • 43
  • 49
0
votes
1 answer

C++ template class self referencing

I am trying to create a class Info which holds a pointer to another object of type Info. I have the following code. template class Info { …. public: Info(…, Info* parentInfo) : …,…
anindyaju99
  • 465
  • 1
  • 5
  • 16