Questions tagged [supertype]

57 questions
0
votes
2 answers

Implications of Supertype and Subtype

Is it bad to implement supertype and subtype to the entire data in a database? I need some advice on this before moving to this direction... For instance, I have these tables as objects and they are related, users pages images entities table as the…
laukok
  • 47,545
  • 146
  • 388
  • 689
0
votes
2 answers

How do I use the super type of generic class in Java?

In my code I have a number of ArrayLists that are passed into a sorting method. Each of these ArrayLists have different Generic types, but all of these types are implementations of Sorter. The sorting method is designed to accept ArrayLists of the…
dagronlund
  • 1,472
  • 3
  • 12
  • 14
0
votes
0 answers

Investment Valuation Data Model Design Issue

I was wondering if somebody could shed some light on the below. I am currently working on building a kimball data warehouse within the financial sector specifically within the pensions industry. Currently we are working to integrate the business…
0
votes
0 answers

C# clone() with compiler enforced subtype recognition

I don't think this is possible but maybe I'm wrong. I want to have a clone() in a supertype public abstract class LivingThing { public abstract T clone() where T : LDBASTobj; } but have the implementing subtypes return its own subtype, and…
user3779002
  • 419
  • 3
  • 12
0
votes
2 answers

Backtrader issue

I have this error when I run my code using Backtrader library: **File "/Users/giovannicaridi/opt/anaconda3/lib/python3.7/site-packages/backtrader/feeds/yahoo.py", line 94, in start super(YahooFinanceCSVData, self).start() TypeError: super(type,…
0
votes
0 answers

Understand Generic supertypes

Whay this code dose not compile ? It is from OCP book. List list = new ArrayList(); list.add(new Exception()); // does not compile list.add(new IOException()); list.add(new FileNotFoundException());
0
votes
1 answer

How to define a Doctrine mappedSuperclass using XML or YAML instead of annotation mapping

The following script comes from https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/inheritance-mapping.html#mapped-superclasses, and was only changed to include a second sub-class. It is my understanding that…
user1032531
  • 24,028
  • 57
  • 174
  • 325
0
votes
2 answers

MySQL trigger to target an attribute of a column

I am working with an overlap super/subtype relationship dealing with person(s) in my DB. What I would like to do is have the overlapping subtypes insert new rows when the supertype gains a new row. I have attached my LRD to clarify the relationship.…
Slyme
  • 75
  • 1
  • 14
0
votes
1 answer

Pass a vector of baseclass to a function which takes vector of superclass

In my code, I have a SuperType which has two SubTypes ... now I have a std::vector& and need to pass this to a function which iterates over the vector and calls only functions from the SuperType ... I need to do this with both…
musicmatze
  • 3,603
  • 6
  • 26
  • 43
0
votes
1 answer

cannot reference "this" before supertype constructor has been called

I've been having trouble with some code lately: public class SightsAdapter extends ArrayAdapter { static int mColorResourceId; public SightsAdapter(ArrayList sights, int colorResourceId) { super(this, 0, sights); …
Mimsy
  • 1
  • 3
0
votes
1 answer

Mysql Subtype and Supertype - database modeling

I'm about to develop a personal project for learning purpose. A real-estate web site, where advertisers (registered users) can publish ads for their properties (apartments, lands, houses, ...) either for rent (for a defined period or undefined…
0
votes
1 answer

Abstract superclass passing supertype to return type

I'm trying to figure out how to (if it's even possible) change the base return type, when the type has yet to be passed to an abstract class. (I'm sorry for such a bland explanation, but I really have no clue how to better explain this) // Base…
Brian Graham
  • 12,107
  • 12
  • 55
  • 95
0
votes
0 answers

super type constructor error

I get the following error message, can anyone see why please? Error:(21, 38) error: cannot reference colourMatch before supertype constructor has been called public class Guess { Colour[] pegs; int correct; int colourMatch; …
M.Lewis
  • 15
  • 2
0
votes
2 answers

Foreign key reference to a specific subtype

This question piggybacks off of Foreign Key to multiple tables but I thought that my elaboration could use its own subject. Say I have the following schema (adapted from @Nathan Skerl's answer in the above link): create table dbo.PartyType ( …
daner
  • 25
  • 4
0
votes
1 answer

cannot reference publicationDate before supertype constructor has been called

Im having trouble with this book class extending from a publication abstract class which extends from a publishable interface class. however when i try to compile it bring up the error message "cannot reference publicationDate before supertype…
Gavin Lau
  • 19
  • 1
  • 9