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
2
votes
1 answer

Doctrine2 Many-To-One self-referecing : parent not generated

I'm using Symfony2 with doctrine and have no problems with relations except for one many-to-one/one-to-many self-referencing relation. I have an entity Customer that can have zero, one or more entities (which are also Customer). When I generate the…
Vincent
  • 384
  • 1
  • 3
  • 11
2
votes
1 answer

Oracle User Defined Objects - collection of self referencing type

Possible Duplicate: How can I define a type in oracle11g that references a collection of that type? I have a scenario in which I have to create a user defined type A which has a collection of type A. I tried doing the following but did not…
2
votes
1 answer

asp.net mvc bi-directional self-referencing many-to-many

I am having difficulty setting up bi-directional self-referencing many-to-many mapping using EF in ASP.NET MVC4 I have: modelBuilder.Entity() .HasMany(i => i.ChildItems) .WithMany() .Map(m => m.MapLeftKey("ItemID") …
2
votes
1 answer

Doctrine - ManyToMany Self Referencing Association + nested toArray() on child elements

I'm trying to perform a ManyToMany self referencing association in my Symfony 2.1 project by following the Doctrine docs: http://docs.doctrine-project.org/en/latest/reference/association-mapping.html#many-to-many-self-referencing My use-case is that…
Bendihossan
  • 2,407
  • 5
  • 22
  • 25
2
votes
1 answer

PostgreSQL: Self-referencing, flattening join to table which contains tree of objects

I have a relatively large (as in >10^6 entries) table called "things" which represent locateable objects, e.g. countries, areas, cities, streets, etc. They are used as a tree of objects with a fixed depth, so the table structure looks like…
Jens
  • 1,386
  • 14
  • 31
2
votes
2 answers

Is there a way I can inline a function to an Action delegate and referenced it at the same time?

Is there a way I can inline the delegated task instead of separating it on another function? Original Code: private void ofdAttachment_FileOk(object sender, CancelEventArgs e) { …
Hao
  • 8,047
  • 18
  • 63
  • 92
1
vote
2 answers

Class Self-Reference Issues

All of my code can be found here. I'm trying to create a complicated tree for a project however this is just the beginning of the project (the construction of a data structure). Also, I think it would help to know that the data structure can be…
James Roseman
  • 1,614
  • 4
  • 18
  • 24
1
vote
1 answer

how do I get a recursive result by querying a self referencing table in mysql?

I have a self-referencing table 'comments' where comments.replyToId REFERENCES comments.ID. My question is, how do I query a database with a self-referencing table to get a result that is properly ordered so that I can represent the result as a tree…
fenerlitk
  • 5,414
  • 9
  • 29
  • 39
1
vote
1 answer

How to make references between expando models?

Update This was my best effort creating the following scheme user = self.auth.store.user_model.create_user(email, password_raw=newpasswd) if not user[0]: # user is a tuple return user[1] # Error message else: # User is created,…
1
vote
1 answer

Self-referencing class in Hibernate or additional table

I have quite common problem, but no idea how to solve it in practice and explain my choice/solution. I have a situation when there are two tables in the database: Account and Contact. They both represent the same data, because one person (Account)…
rivasket
  • 377
  • 2
  • 6
  • 18
1
vote
1 answer

hibernate property-ref equivalent not present in grails

I am new to grails and am currently trying to map an Employee class. Each employee may or may not have a manager. Also, each employee (if he is a manager) will have a list of subordinates. Mapping to this extent was relatively easy with the hasMany…
maverick13
  • 56
  • 4
1
vote
2 answers

MySQL Query - Count Number of Records that Don't Reference Themselves

I'm still trying to use my limited knowledge of MySQL to help out a team at work, as in my last question. The Warehouse table has a foreign key called nearest, which relates to another WarehouseID. What query generates a list of Warehouse records…
BrianNeil
  • 13
  • 3
1
vote
1 answer

Self-referencing relationship in Entity Framework

I am using Entity Framework 4.1 code first and I have two entities and one abstract class that both entities inherits from. public abstract class Customer { public long CustomerId { get; set; } public string Rating { get; set; } public…
RobinHu
  • 374
  • 2
  • 14
1
vote
2 answers

T-SQL Sum Since Condition Last Met

I'm trying to do a sort of running total with a variable window size. I want to sum a value from the current row to the last time another row met a condition. Mock Data: I want a formula for the last…
1
vote
1 answer

How does Vec::push work for self referencing types?

Quoted from vec::push implementation: pub fn push(&mut self, value: T) { // This will panic or abort if we would allocate > isize::MAX bytes // or if the length increment would overflow for zero-sized types. if self.len ==…
user3698446
  • 107
  • 6