FAQ Database Discussion Community


ReactJS and parent / child components: How do I build out this conceptual calendar?

javascript,reactjs,hierarchy,uicomponents
I am working on a ReactJS project, a calendar as an example for the concept I'm after, where the desired behavior is to display: January 1, 2016 Activity 1 Activity 2 January 2, 2016 Activity 3 January 4, 2016 Activity 4 Activity 5 January 8, 2016 Activity 6 In other...

Table per Class hierarchy - get only Superclass with Criteria API, discriminator not working?

java,hibernate,hierarchy,criteria-api,hibernate-criteria
I have Table per Class hierarchy with 3 classes, Academy: @Entity @Table(name = "academy") @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) @DiscriminatorColumn( name="hibernate_hierarchy_discriminator", discriminatorType=DiscriminatorType.STRING ) @DiscriminatorValue(value="ACADEMY") public class Academy { // } Class Institute, which extends Academy: @Entity @Table(name = "institute") @DiscriminatorValue(value="INSTITUTE") public class Institute extends Academy{ // } And class Department, which extends Instutute: @Entity...

Select from a hierarchy based on a range of ID's

sql,sql-server,tsql,tree,hierarchy
I have table holding a hierarchical structure so basically it has 3 columns as : What I want is to select from this table by a range of ID's for example : Id IN (1,4,8,18) which results to : In other word a row must come into result set with...

XAML Windows Store hierarchical View

winrt-xaml,hierarchy
I want to have a hierarchical display of my items. My items for instance looking like this pseudo-class: public class ListItem { public string Title {get; set;} public ObservableCollection<ListItem> Children {get; set;} } And I want to have them displayed like this: I don't want to collapse or expand items...

postgres hierarchy - count of child levels and sort by date of children or grandchildren

postgresql,sorting,hierarchy,children
I would like to know how to write a postgres subquery so that the following table example will output what I need. id parent_id postdate 1   -1 2015-03-10 2     1 2015-03-11 (child level 1) 3     1 2015-03-12 (child level 1) 4     3 2015-03-13 (child level 2) 5    -1 2015-03-14 6    -1 2015-03-15...

T-SQL Ordering a Recursive Query - Parent/Child Structure

sql,tsql,recursion,order,hierarchy
I am trying (and failing) to correctly order my recursive CTE. My table consists of a parent-child structure where one task can relate to another on a variety of different levels. For example I could create a task (this is the parent), then create a sub-task from this and then...

query from the child to the great great grandfather list in ORACLE 12c

sql,oracle,parent-child,hierarchy,oracle12c
I need help with a SQL query. I have this table: ITEM PARENT 1 NULL 2 1 3 2 4 2 5 3 6 5 7 5 8 4 9 8 10 1 11 10 12 10 13 8 Chosen an item, i'd need the following result: Chosen item 9:...

SQL to retrieve parent-child relationship in parent-child order, from a self referencing table

sql,hierarchy
I use the following query to retrieve the parent-child relationship data, from a table which is self referencing to the parent. -- go down the hierarchy and get the childs WITH ChildLocations(LocationId, FkParentLocationId, [Level]) AS ( ( -- Start CTE off by selecting the home location of the user SELECT...

Get all parents for a child

sql-server,tsql,recursion,hierarchy,recursive-cte
I want to retrieve the parentid of an id, if that parentid has a parent again retrieve it, and so on. Kind of hierarchy table. id----parentid 1-----1 5-----1 47894--5 47897--47894 am new to sql server and tried, some queries like: with name_tree as ( select id, parentid from Users where...

Generate Tree Structure from Arrays Java

java,arrays,json,tree,hierarchy
I have an ArrayList of String arrays in java named: List<String[]> initialList = new ArrayList<String[]>(); This contains the following data (This is a snippet of it, it actually includes about 900 rows that go on to include Charlie, Delta, Echo, each with the same structure as these: [Alpha, A1, 1,...

Distance and metrics between datasets

dataset,artificial-intelligence,distance,hierarchy
I have almost 30 different data-sets. Each of them contain a different number of variables and the dimension is around 46. I'm trying to measure the distance between these data-sets, rather than the distance between the items within each data set themselves. My proposal is to find the mean for...

Is it OK to have an empty method?

java,oop,subclass,hierarchy,chess
Is it OK to have an empty method and have it overridden in its subclass(es)? This is how it would look like in my code. public class Rook() { public void voidCastleRight() { } } public class ShortRook() extends Rook { @Override public void voidCastleRight() { getPlayer().setkSC(false); //void King Side...

What is the proper way to create an exception hierarchy?

c++,exception,c++11,hierarchy
I understand that to properly catch exceptions using multiple inheritance I need to use virtual inheritance. I'm not necessarily advocating the controversial use of multiple inheritance, but I do not want to design systems that make its usage impossible. Please do not distract from this question to advocate or attack...

SSAS cube: force Budget measure granularity drill down to the leaf level of calendar dimention (split Quarter Budget between Monthes, Weeks and Dates)

ssas,hierarchy,olap,granularity
Our Budget/Plan has Quarter grane, while Fact sales data is stored Dayly. To build Plan-Fact reports for Monthes, Weeks and Dates - I need to split Budget evenly between Calendar dates. How can I do this within a Cube? After hours of googling I've found references to [IgnoreUnrelatedDimensions] property of...

How can I get the return value of a superclass method without executing it?

java,equals,hierarchy
This is my superclass equals() method: public boolean equals(Object other){ Car c = (Car)other; if(this.make.equals(c.make) && this.model.equals(c.model)){ System.out.println("True, Cars are equal"); return true; } else System.out.println("False, Cars are not equal"); return false; } Here is my subclass equals() method: public boolean equals(Object other) { GreenCar g = (GreenCar) other; if(super.equals(g)==true){...

MySQL self join with limited hierarchy

mysql,sql,hierarchy,self-join
Hi I have a self joining MySQL table I am using for comments and replies. CREATE TABLE comments (id INT, parent_id INT, comment VARCHAR(50)); INSERT INTO comments VALUES (1, 0, 'comment 1' ), (2, 0, 'comment 2' ), (3, 0, 'comment 3' ), (4, 1, 'comment 1 - reply 1'...

organize sql heirarchy

sql,tsql,hierarchy
I have the following table: Id Son RowOrder Technology 1 8 NULL fa 8 0 NULL fa 9 15 NULL gr 15 0 NULL gr I would like to create an sql query that will do an "order by" by the following order: technology, "father" (a record that has a...

Basic Java inheritance exercise

java,inheritance,hierarchy,multiple-inheritance
I'm learning Java and I'm doing this exercise and I have to say what the main method prints. Its goal is to better understand Java inheritance. interface X extends Remote{ A m(B bb) throws RemoteException; } class A implements Serializable{ int a; A m(A aa){ aa.a = 3; System.out.println("A.m"); return...

Why does std::map reinstantiate it's value when it's created through operator[]

c++,pointers,visual-studio-2005,hierarchy,stdmap
I implement a class that stores a number of Parent objects inside an std::map. Each Parent has a Child. That Child has a pointer to it's Parent, which is set in Parent's constructor. It goes like this: I call std::map::operator[], it calls Parent's constructor, which sets child.parent to this, and...

Is there a before() function in Protractor?

angularjs,node.js,automated-tests,protractor,hierarchy
I am aware there is a beforeEach() function which I am currently using. However, I would like to be able to run a before function for all my parent level 'describes' and not the 'it' functions within them. For example my test looks like this (with an x in front...

PowerBI hierarchy creation without the cloud

excel,hierarchy,powerpivot,powerview,powerbi
Right now we can create hierarchies in PowerPivot but I'm pretty sure I can't do it in PowerBI. I could create a Data Model in PowerPivot and use that for PowerBI I think. Is there any other work around that could be more desktop based? Thanks! Mike...

how to break up the monolithic mkYesod block safely

haskell,module,hierarchy,yesod
This question is more to help my understanding of Yesod than anything else. Take the example at http://www.yesodweb.com/book/basics and in particular the code generated by the mkYesod TH function. The problem that I perceive is that this TH generates both the route data type (data Route HelloWorld = HomeR) and...

Double dispatch and factory pattern

c++,oop,hierarchy,double-dispatch
I've got the following code currently (not working): #include <iostream> #include <vector> class Circle; class Rectangle; class Shape { private: Shape() {}; public: virtual ~Shape() {}; friend class Circle; friend class Rectangle; }; class Creator { public: virtual ~Creator() {}; virtual Shape* create() = 0; virtual bool equals(Shape& s) {...

Recursive parsing of hierarchical Twig layout with parents, children, grandchildren

symfony2,macros,twig,hierarchy
In my SF2 project I have an entity (Category) which I am representing in a hierarchical format with a parent at the top, followed by children, grandchildren etc. The Category entity has a getChildren method, which works and returns Category entity objects. I'm trying to work out a way to...

Aggregative sum of objects belonging to objects residing inside hierarchy structure

sql,sql-server,sql-server-2008,hierarchy
My problem is similar in a way to this one, yet different enough in my understanding. I have three tables: Units ([UnitID] int, [UnitParentID] int) Students ([StudentID] int, [UnitID] int) Events ([EventID] int, [EventTypeID] int, [StudentID] int) Students belong to units, units are stacked in a hierarchy (tree form -...

Using EntityFramework.HierarchyId in CodeFirst approach, The Type hierarchyid is not qualified with a namespace or alias

entity-framework,ef-code-first,entity-framework-6,hierarchy
I'm starting new project and I'd like to use HierarchyID in my DB model and CodeFirst approach. So I added EntityFramework.HierarchyId using nuget. But when I run Update-Database, I receive this exception: Schema specified is not valid. Errors: (0,0) : error 0040: The Type hierarchyid is not qualified with a...

Calculating Sum of Hierarchical Query, Grouped by Type

sql,database,oracle,hierarchy
I have a table TRANSFERS which contains these columns: account_id, father_account_id, amount, type. This table represents all transfers of money made from the specific account, their amount, and what were they paying for by types (such as food/school/taxes etc). What I need to do, is for every main account (an...

How can I create hierarchical bar chart in d3.js

javascript,d3.js,bar-chart,hierarchy,hierarchical
I wanted to use the Sortable Bar Chart of Mike Bostock without it's transition property and sort the bars according to their lenght but I couldn't. I want the bars just like this. without interactivity. <!DOCTYPE html> <meta charset="utf-8"> <body> <style> body { font: 10px sans-serif; } .bar rect {...

How to generate sequence numbers for hierarchical data in sql server

sql-server,hierarchy,hierarchical-data
I have create a function in sql to get a serial number in hierarchy.I have table called Goals.the structure of table is below GoalId ParentId Goalstatement ---------- ---------- ---------- 1 0 abc 2 0 def 3 1 acc 4 2 efc 5 3 dec 6 0 efc 7 3 jhg...

How ReSharper chooses whether to show library types in hierarchies inspector?

c#,types,resharper,hierarchy,inspect
Sometimes ReSharper is kind and shows all types. Sometimes only my own types. Can't follow the logic behind this... How to force it to show all types? Tried with Navigate -> Derived Types and Inspect -> Type Hierarchies. Visual Studio 2013 ReSharper 9...

php, laravel, log4php: Class 'Apache\Log4php\Hierarchy' not found error

php,laravel,hierarchy,log4php
I'm new to php and i'm using log4php with laravel. My project structure is ->Root ->Laravel ->app ->folderx ->abc.php ->otherfolders . . ->vendor ->composer.json (contains log4php and laravel) ->logconfig.xml I'm trying to initialize the logger from inside abc.php, Logger::configure('../../../logconfig.xml'); but it gives the error message Class 'Apache\Log4php\Hierarchy' not found I...

When I click select button after category button, why isn't the String being printed and null being printed instead?

java,class,user-interface,hierarchy
package simpleclass; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.FileNotFoundException; import java.io.IOException; import javax.swing.JButton; import javax.swing.JFrame; public class SimpleClass extends BaseClass { JButton b1 = new JButton("Category"); JButton b2 = new JButton("Select"); JFrame f = new JFrame(); SimpleClass() { f.add(b1); f.add(b2); f.setLayout(new GridLayout(1, 2)); f.setSize(200, 200); f.setLocationRelativeTo(null);...

MYSQL: How to update uuid in multiple tables

mysql,sql-update,foreign-keys,hierarchy,guid
I have 2 tables: table1 -UUID Id -CHAR NAME table2 -UUID Id -UUID table1Id (foreign key for table1 Id) -CHAR CHILD_INFO I need to update these 2 tables Ids to new UUID. (For some copy reason) How to do this with one update (1) Change talbe1 Id to new, 2)...

Select tree by leaf in Oracle Database

oracle,hierarchy,hierarchical-data
There is hierarchical queries in Oracle, using CONNECT BY PRIOR. Everybody knows, how to select children by parent, but I need to select parent by child. Here is my table: ID PID NAME TYPE 1 null EARTH PLANET 2 1 USA COUNTRY 3 2 CALIFORNIA STATE 4 3 Los_Angeles CITY...

Class name in PHP

php,class,hierarchy,classname
Hello, I want to class name are very specific. Like: form.class.php or database.class.php and i access them via autoload. But sometimes i need a function which not specific. For example: get avatar for current user or relation between two user. I am using function.class.php for these function but function.class.php is...