Questions tagged [supertype]

57 questions
0
votes
1 answer

Select all full records in a supertype/subtype SQL pattern

In a relational supertype/subtype structure where, for example, I have a supertype table entity with an entity_type column and a number of subtype tables, is there any way I can go about querying all entities with their full records, that is somehow…
Dan
  • 4,582
  • 3
  • 17
  • 26
0
votes
0 answers

Dynamically Loading Classes with Generic Supertypes

The purpose of my code below is to call the initialize() method all of the classes in a package that extend GsonLoader. The error which I am receiving is: java.lang.InstantiationException: com.salesy.utility.gson.impl.NPCSpawnsLoader at…
Tyluur
  • 71
  • 1
  • 2
  • 9
0
votes
1 answer

Java using supertype of several enums

I want to be able to use a supertype over different enums, the code consists of three parts: Manager.search: public final List search(final Order order, final Field field, final AbstractConstraint... c) throws SearchException { if (c.length…
skiwi
  • 59,273
  • 29
  • 118
  • 198
0
votes
1 answer

MYSQL - INSERT with SuperType/Subtype and auto increment

Imagine I have the following database structure: product_id in Products table is Auto-Increment How can I Insert something in the Products table and either Amazon_Books or Starbucks_Products without losing track of the product_id? My first…
Cristian
  • 1,919
  • 3
  • 21
  • 33
0
votes
2 answers

How to resolve The method addView(View, int, LinearLayout.LayoutParams) of type YourLayout must override or implement a supertype method

I've already tried setting the java sdk version to 1.6(It was already set correctly). I've also tried cleaning the project as well as restarting eclipse. My definition appears correct as I used eclipse's Source > Override/Implement Methods create…
Jim Baca
  • 5,684
  • 2
  • 20
  • 30
0
votes
1 answer

Subclass with JFrames

Guys I am developing a normal system that has a superclass called activity and it has three subclasses for it, 1 is Club, 2 is Sports and 3 is Events. Now I want to calculate the total merits gained by a student based on inputs by the staff. The…
Darsshan
  • 664
  • 1
  • 8
  • 18
0
votes
1 answer

ERD including supertype, subtype database

I'm drawing an ERD for a database and want to know if you need to include the supertypes and sub-types in the ERD. If yes, how to represent it. Thanks.
Cho Dien
  • 5
  • 3
0
votes
3 answers

Is it better to code to SuperType or Interface?

What is considered general best practice: Reference via the super type? public class BirdFeeder{ public Feed(Bird bird){...} } Or via a Interface public class BirdFeeder{ public Feed(IBird iBird){...} } Personally I prefer interfaces…
g.foley
  • 2,062
  • 3
  • 19
  • 25
-1
votes
3 answers

How do I call the functions of the parent class from an instance of a subclass?

normally, (in subtype definition) I use function enable() { parent::enable(); } function disable() { parent::disable(); } and then I call $subtypeinstance->enable() but can I also use something like $subtypeinstance->parent::enable() or…
Uğur Gümüşhan
  • 2,277
  • 4
  • 29
  • 59
-1
votes
1 answer

When I extend a class, do I call the static functions directly from a subtype or should I use parent:: each time?

When I defined a function in a supertype and called without parent:: it gave me and error teling me it's undefined function. I am wondering if I should use parent:: each time or if I am doing something wrong somewhere else. I have a class, named…
Uğur Gümüşhan
  • 2,277
  • 4
  • 29
  • 59
-1
votes
3 answers

Static final in supertype

Why is it that even if you have declared a private static final variable, a color - defaultC, let's say - then you still cannot use this.defaultC in the super constructor (i.e. you can only use super(defaultC) and not super(this.defaultC) even…
dylnmc
  • 3,276
  • 3
  • 20
  • 37
-2
votes
1 answer

Scala - Trait returns different objects

I have a question about traits in Scala. I have a trait returns a type of object (AA or BB) depending on the value of parameter country. My implementattion covers the following approach: trait firstT{ def GetType(country: String) : OType = { …
jmaag
  • 3
  • 2
1 2 3
4