Announcement Announcement Module
No announcement yet.
Help needed with Roo Polymorphism Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help needed with Roo Polymorphism

    Dear Sirs et Madames,
    I am creating an application which has polymorphism in its design. I have a class PersistentEntity, and another class called Attribute (abstract), and classes DateAttribute,StringAttribute and NumberAttribute which all are subclasses of Attribute.

    A PersistentEntity object has a set of Attributes:

    PHP Code:
    package com.testing.genericappcreator.domain;

    import java.util.HashSet;
    import java.util.Set;

    import org.springframework.roo.addon.entity.RooEntity;
    import org.springframework.roo.addon.javabean.RooJavaBean;
    import org.springframework.roo.addon.tostring.RooToString;

    import javax.persistence.CascadeType;
    import javax.persistence.ManyToMany;
    import javax.validation.constraints.NotNull;
    import javax.validation.constraints.Size;

    public class PersistentEntity {

    private String entityName;

    @Size(max 255)
    String entityDescription;
    ManyToMany(cascade CascadeType.ALL)
    Set<com.testing.genericappcreator.domain.Attributeattributes = new HashSet<com.testing.genericappcreator.domain.Attribute>();

    Now when I create a web tier
    PHP Code:
    controller all ~.web 
    in roo, I can navigate to relevant page in application and create a few NumberAttribute and DateAttribute objects, etc. However when I got to the create PersistentEntity page, in the field for Attributes is the message "No attributes found"...why is it not finding the subclass objects of Attribute, does hibernate not support polymorphic queries?

    Could anyone please advise?

    Thanks in advance...