Serialization in self-referencing classes

Okay, so I'm using Kodo 2.4.0, and I have a class Employee that has a List
property named 'managedEmployees':
private List managedEmployees = null;
The objects in this list are themselves of the class Employee. The JDO
configuration for it is:
<field name="fManagedEmployees" default-fetch-group="false">
<collection element-type="Employee" embedded-element="false"/>
<extension vendor-name="kodo" key="table" value="ps_employees"/>
<extension vendor-name="kodo" key="fEmployeeId-data-column"
value="emplid"/>
<extension vendor-name="kodo" key="fEmployeeId-ref-column"
value="manager_id"/>
</field>
When I serialize an object of this class it appears that Kodo is loading
the entire nested graph of Employees! Is there a configuration setting to
prevent this? Or need I create two different classes: Manager and
Employee, with managedEmployees as a property of Manager alone?

Self-referencing or not, JDO always recursively pulls in all relations during
serialization. If you do not want this to happen, make your object transient
(pm.makeTransient (obj)) before serializing it.

Similar Messages

  • JPA: How to initialise an entity for a self-referencing table?

    I am working on a project that requires a self-referencing table:
    mysql> show create table attributes\G
    *************************** 1. row ***************************
           Table: attributes
    Create Table: CREATE TABLE `attributes` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `parent` int(11) DEFAULT NULL,
      `type` int(11) DEFAULT NULL,
      `name` varchar(128) DEFAULT NULL,
      PRIMARY KEY (`id`),
      KEY `parent` (`parent`),
      KEY `type` (`type`),
      CONSTRAINT `attributes_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `attributes` (`id`),
      CONSTRAINT `attributes_ibfk_2` FOREIGN KEY (`type`) REFERENCES `attributes` (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=latin1
    I used NetBeans to generate an entity class from the table:
    @Entity
    @Table(name = "attributes")
    @XmlRootElement
    @NamedQueries({
        @NamedQuery(name = "Attributes.findAll", query = "SELECT a FROM Attributes a"),
        @NamedQuery(name = "Attributes.findById", query = "SELECT a FROM Attributes a WHERE a.id = :id"),
        @NamedQuery(name = "Attributes.findByName", query = "SELECT a FROM Attributes a WHERE a.name = :name")})
    public class Attributes implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Basic(optional = false)
        @Column(name = "id")
        private Integer id;
        @Size(max = 128)
        @Column(name = "name")
        private String name;
        @OneToMany(mappedBy = "parent")
        private Collection<Attributes> attributesCollection;
        @JoinColumn(name = "parent", referencedColumnName = "id")
        @ManyToOne
        private Attributes parent;
        @OneToMany(mappedBy = "type")
        private Collection<Attributes> attributesCollection1;
        @JoinColumn(name = "type", referencedColumnName = "id")
        @ManyToOne
        private Attributes type;
        @OneToMany(cascade = CascadeType.ALL, mappedBy = "attributes")
        private Collection<ItemAttributes> itemAttributesCollection;
        @OneToMany(mappedBy = "ivalue")
        private Collection<ItemAttributes> itemAttributesCollection1;
    But how can I write a constructor for this entity? The auto-generated code gets around the issue by doing nothing; the constructor is empty. I can't help thinking that if I set the parent and type references to anything with new Attributes(), then it will recurse out of control. What else can/shall I do? I know how to rewrite it to not use the entity relations, but I'd prefer to make it work.

    Cymae wrote:
    I don't want to call the hash table creation method because from what i understand about interfaces the idea is that your main method doesnt know the table is actually a hash table...is that right?That's not exactly the idea. The idea to use the interface as the type instead of the implementation, is that your class probably doesn't need to know the full type. This makes it easy to change the implementation of the interface if needed. However, somebody at some point has to create the concrete object, a HashTable.
    Basically, an interface describes a behavior, and a class that implements an interface decides how to actually perform this behavior. It is obviously impossible to perform the behavior if you are not told how to perform it.
    Table table = new HashTable() is the correct way to do it. This means that if you ever need you Table implementation to change, the only thing you need to change in your whole class is this line. For example you might want Table table = new FileTable().

  • Problem using self-referencing type parameter

    I seem to be having trouble using a self-referencing type parameter (or what's the name for it ;)
    Please consider this code:
    class Test<T extends Test<T>> implements ITest<T> {
         public T foo() {
              // does not work?!
              //return this;
              @SuppressWarnings("unchecked")
              T result = (T) this;
              return result;
    interface ITest<T extends ITest<T>> {
         T foo();
    }I need ITest.foo() to return T so that it would return the correct type when used in subinterfaces. I can see that Test.foo() must return T, so that is why I declared "T extends Test<T>".
    Trouble is, why does "this", which also implements ITest<T>, not satisfy the requirement of returning T?

    This is a common question. The problem is a flawed assumption about the declaration of ITest.
    The assumption is that:
    interface ITest<T extends ITest<T>>means that any implementation of ITest must be parameterized by itself. This is not the case.
    Consider the following
    public class Test<T extends Test<T>> implements ITest<T> {
        public static void main(String[] args){
            Bar b = new Foo().foo();
        public T foo() {
            @SuppressWarnings("unchecked")
            T result = (T) this;
            return result;
    class Foo extends Test<Bar> {
    class Bar extends Test<Bar>{
    interface ITest<T extends ITest<T>> {
    }Compiles and then fails with a classcastexception.
    Look again at ITest. The generic declaration requires that implementations are parameterized by self-parameterized instances of Test. That's different than saying the implementation itself is self-parameterized. The distinction is subtle but in the end you cannot declare classes that force sublcasses to be self-parameterized.
    You can, however, declare methods that force their arguments to be self-parameterized.

  • Self-referencing enum

    Is it not possible to create a "self-referencing" enum? For example:
    public enum Family {
    dad(null, null), mom(null, null), son(dad, mom);
    private final Family father;
    private final Family mother;
    Family(Family father, Family mother) {
    this.father = father;
    this.mother = mother;
    public Family father() { return father; }
    public Family mother() { return mother; }
    The code above creates an entry in the enum called "son" that contains a reference to "dad" and "mom" that are both elements in the same enum. Code that uses this enum will find that both "father" and "mother" are null for "son". Is that right? Is there a better way or prefered way to do this?

    This is the results I get with using the same code you supplied:
    nullThat's very odd. My java version is:
    java version "1.5.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b00)
    Java HotSpot(TM) Client VM (build 1.5.0_06-b00),
    Oh well.
    Note: Are you using exactly the source code you posted?
    I literally copied down your Family code into Family.java,
    then compiled+run. If you copied them to a new empty
    directory (so that other classes in your project are not
    interfering), and you still get that result, then I believe it's
    a Java bug.

  • EF6 Code First: Many to Many Self referencing relationship

    Hi,
    Could any one show me an example for many to many self referencing?
    The scenario is that I have a user table that will contains collection of users as friends.
    Thanks,
    Bo

    Hi Kalman,
    Really appreciate your answer.
    I just wonder if I can, alternatively, set up tables as below,
    Public class user
    public int userId{get; set;}
        public
    virtual
    ICollection<User> CircleOneFriends { get; set; }
        public virtual ICollection<User>
    CircleTwoFriends { get; set; }
       public User()
    CircleOneFriends
    = new HashSet<User>();
    CircleTwoFriends = new HashSet<User>();
    public class UserConfiguration : EntityTypeConfiguration<User>
        public
    UserConfiguration()
           this.HasMany(x=>x.CircleOneFriends) .WithMany(x=>x.CircleTwoFriends).Map(x=>x.ToTable("Friends"))
    Do you think that will work in my case?
    Thanks a lot,
    Bo

  • RMI Classloading and referenced classes

    Hi All,
    I am trying to develop an application that uses a thin client methodology using RMI. What I mean by thin client is that there will only be several classes to start the client side application and invoke the rmi server. The rmi server will return the class files (mainly Swing/Charva JFrame and JPanel classess, which I refer to as the UI classes), which will be instantiateds and referenced by an interface that all the classes implement. Many of the UI classes also instantiate classes for control and presentation (i.e. extended JText Fields and other java classes). It seems that because RMI uses the URLClassLoader, the referenced class types do not have to reside on the client side on disk. I believe this is because RMI automatically loads both the classes that were requested by the client and any additional classes that are referenced by the requested classes. My first question is:
    1. Are the referenced classes loaded at the same time the called class is loaded, or when the called class is instantiated?
    2. We store the rmi requested .class files in a hash table the first time they are requested. We do this so we do not need to go accross the network the next time we need to reference and instanitiate the class; we just get if from the hash table. My question is, if we instantiate the class file from the hash table, does RMI reload the referenced class files (the classes that are instantiated within the object I am instantiating, i.e Extended JText and UI Controller classes) from the RMI server or are the loaded from memory on the client side?
    Any responses are greatly appreciated.
    Elliott Gonshor
    QuestDiagnostics

    Hi,
    I remembered that some of the AWT components have
    their corresponding Serializable form. I am not too sure
    if Swing components has such a form. But since you
    have make it happened, I think that it should be yes.
    I found some words in the book, Java Enterprise in a
    Nutshell. I excerpt some of them in the book as follows :
    ========================
    java Djava.server.rmi.codebase=-http://objhost.org/classes/ Regaccount
    We've setting the codebase to http://objhost.org/classes/,
    so we have to make sure that an htpp server is running on
    the objhost.org machine and that the necessary class files
    (eg, the AccountImpl stub class) are in the classes
    directory of that http server's document root
    Now we can run the AccountClient class on the remote
    client as before, but the client's host machine doesn't
    have the stub class for the Account remote object
    available locally. WHEN THE AccountClient TRY TO
    LOOK UP THE REMOTE Account OBJECT, we want
    the stub class to be loaded remotely. ......................
    ===================================
    You may notice that I uppercase one sentence !
    So if I believe the description, then I think those
    referenced class files should be loaded when the
    called class is instantiated. Since it happens at the
    time when the action of look it up.
    Since it has been load into the client, I think that it should
    loaded those reference class on the client side. Although
    it just said that
    but the client's host machine doesn't
    have the stub class for the Account remote object
    available locally. ...........
    it seems to mean that it does not have it locally so it
    start loading it from remote. So it might be the case if
    it existed in local, it should be cached and without
    reloaded from remote.
    It is my assertion. I could not promise ii it is right
    or not. In fact, Try it might be better.
    For the first question, you may try to insert some
    flag in the code which is downloaded firstly and
    observe if it happen in which phase, loaded at
    the same time, or when the called class is instantiated
    For the second question, You may try to make it
    work, that is, all classes have been downloade to
    the client side and works smoothly. Consider that
    remove those reference class file stored in the remote
    side. and request again.
    if it works, it means that local class is reference firstly.
    if not, it means that it reloaded from the remote side
    without considering the copy in local.
    if all of them are wrong , Well ..... God bless you !
    hahaha
    good luck,
    Alfred Wu

  • Need help on self referencing a ssrs report

    Hi All,
    I have a graph on one of my report which shows data on level 1 by default and go on showing level 2 and level 3 data on successive clicks. This has been achieved by self referencing a ssrs report and passing respective parameters. Now to identify which level
    data needs to be shown on graph, I have used one more parameter which default value is 1 and go on increasing to 2 then 3 on successive click and this parameter value is used in group expression of graph. This works just fine.
    But the real problem has occurred when you go and select report parameters which are corresponding to level 1, level 2 and level 2 values and click on apply in between. For e.g. Assume level 1=Region, level 2=SubRegion and level 3=Country. When you run this
    report it shows region wise data on graph and value of fourth parameter is 1, now when you click on graph it takes you to level 2 i.e. it shows sub region wise data on graph and value of fourth parameter is 2 but when you go and select all region, sub region
    and countries from report parameters and click on apply button then it should show data on graph region wise but since the time you were selecting parameter data was sub region wise and value of fourth parameter was 2 it shows data for all sub regions which
    is weird and not acceptable at all. 
    I am hoping SSRS should provide a way to pass parameters just like we pass in action on any control within ssrs report to solve this issue. Please help me out to solve this issue or let me know if need more infor.

    Hi,
    There was an error reading from the pipe: Unrecognized error 109 (0x6d).
    One reason was inconsistent binding between client and server <netNamedPipeBinding> <security mode="None"></security>... (no
    communication)
    The other intermittent issue was time-out related.
    For more information, you could refer to:
    http://stackoverflow.com/questions/15836199/wcf-namedpipe-communicationexception-the-pipe-has-been-ended-109-0x6d
    http://stackoverflow.com/questions/22334514/wcf-named-pipe-error-the-pipe-has-been-ended-109-0x6d
    Regards

  • Best practice: self referencing table

    Hallo,
    I want to load a self referencing table to my enterprise area in the dwh. I am not sure how to do this. What if a record references to another record which is inserted later in the same etl process? There is now way to sort, because it is possible that record a references to record b and record b references to record a. Disabling the fk constraint is not a good idea, because this doesn't prevent that invalid references will be loaded? I am thinking of building two mappings, one without the self referencing column and the other only with it, but that would cause approx. twice as much running time. Any other solutions?
    Regards,
    Torsten

    Mind sharing the solution? Would be interested to hear your solution (high level).
    Jean-Pierre

  • Problem with self referencing cells

    Hello there,
    I'd like to have two columns that are NULL, unless the other column has a value entered into it.
    This seems to create an infinite lookup loop of self referencing.
    Can anyone suggest a work around?
    Please see example
    http://public.iwork.com/document/?a=p175104233&d=self_reference.numbers

    If for instance you have
    cell B2 = IF(C2="","","Not Null")
    and
    cell C2 = IF(B2="","", "Not Null")
    then, yes, you have a circular reference
    It sounds like what you want is if you enter (by hand, overwriting the formula that is there) a value in B2 then the formula in C2 will result in a value (not null). If you, instead, enter a value in C2 then the formula in B2 will result in a value.
    Try this addition to the formula:
    B2=IFERROR(IF(C2="","","not null"),"")
    C2=IFERROR(IF(B2="","","not null"),"")
    In other words, wrap it all up in an IFERROR
    Message was edited by: Badunit

  • Failed to Call Self Written Class Files in JAVA 1.4

    While compiling java application in JAVA 1.4 environment, import command for self written class file fails even though classpath is set and declared during compilation.
    It flashes like ". is expected" Please help,
    Regards,
    Avijit Dutta (e-mail - [email protected])

    I had a similar problem with 1.4:
    since 1.4 java doesn't accept imports of "top-level packages" any more, i.e. classes, that don't belong to a package can't be imported in other classes.
    --> always put your self written classes into a package
    then you will be able to import them.
    hoschi

  • Java stored procedures and referencing classes

    We are referencing to some classes/libraries which are not present in the database. In normal java world, you specify the libraries/classes needed to run your piece of code in the CLASSPATH and that forms part of your complete code.
    Can java stored procedures in the database refer to libraries or class files it requires on the file system rather than the database? Is it possible to make this happen?
    Thanks

    pshiva,
    Posting the same question to multiple forums usually doesn't increase your chances of getting an answer, and it just frustrates those wishing to answer you with the result being that any future questions you post may have less chance of being answered -- because of your uncourteous, initial behaviour.
    I have answered your other thread:
    java stored procedures and referencing classes
    In my opinion, that forum (the Database JVM forum) is the most appropriate for your question.
    Good Luck,
    Avi.

  • ORA-02291 during MERGE on self-referenced table

    Hello,
    I encountered error ORA-02291 when I tried to use MERGE statement on the table with "self-referenced" foreign key. Using the foreign key deferrable did not help. The only one thing, which helped me, was using errorlog table. See the demonstration:
    Working as common user:
    SQL> CONNECT scott/tiger
    First of all, I create table and (not deferrable) constraints:
    CREATE TABLE fkv (
         id NUMBER(1) CONSTRAINT nn_fkv_id NOT NULL,
         parent_id NUMBER(1) CONSTRAINT nn_fkv_paid NOT NULL
    ALTER TABLE fkv ADD CONSTRAINT pk_fkv_id PRIMARY KEY (id);
    ALTER TABLE fkv ADD CONSTRAINT fk_fkv_paid FOREIGN KEY (parent_id) REFERENCES fkv(ID) NOT DEFERRABLE;
    INSERT is working well:
    INSERT INTO fkv (
         id,
         parent_id
    SELECT
    1,
    1
    FROM
    DUAL;
    COMMIT;
    1 rows inserted.
    commited.
    MERGE statement using UPDATE branch is working well too:
    MERGE INTO fkv USING (
    SELECT
    1 AS ID,
    1 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID);
    COMMIT;                                        
    1 rows merged.
    commited.
    And now is coming the strange behaviour:
    MERGE INTO fkv USING (
    SELECT
    2 AS id,
    2 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID);
    SQL Error: ORA-02291: integrity constraint (SCOTT.FK_FKV_PAID) violated - parent key not found
    ROLLBACK;
    rollback complete.
    Ok, even it is not a good solution, I try deferrable constraint:
    ALTER TABLE fkv DROP CONSTRAINT fk_fkv_paid;
    ALTER TABLE fkv ADD CONSTRAINT fk_fkv_paid FOREIGN KEY (parent_id) REFERENCES fkv(id) DEFERRABLE INITIALLY DEFERRED;
    table FKV altered.
    table FKV altered.
    MERGE INTO fkv USING (
    SELECT
    2 AS id,
    2 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID);
    1 rows merged.
    COMMIT;
    SQL Error: ORA-02091: transaction rolled back
    ORA-02291: integrity constraint (SCOTT.FK_FKV_PAID) violated - parent key not found
    ... deffered constraint did not help :-(
    Let's try another way - errorlog table; for the first with the not deferrable constraint again:
    ALTER TABLE fkv DROP CONSTRAINT fk_fkv_paid;
    ALTER TABLE fkv ADD CONSTRAINT fk_fkv_paid FOREIGN KEY (parent_id) REFERENCES fkv(ID) NOT DEFERRABLE;
    table FKV altered.
    table FKV altered.
    BEGIN
    sys.dbms_errlog.create_error_log (
    dml_table_name => 'FKV',
    err_log_table_name => 'ERR$_FKV'
    END;
    anonymous block completed
    Toys are prepared, let's start with error logging:
    MERGE INTO fkv USING (
    SELECT
    2 AS id,
    2 AS PARENT_ID
    FROM
    DUAL
    ) a
    ON (
    fkv.id = a.id
    WHEN MATCHED THEN
    UPDATE SET
    fkv.parent_id = a.parent_id
    WHERE
    A.ID IS NOT NULL
    DELETE WHERE a.id IS NULL
    WHEN NOT MATCHED THEN
    INSERT (
    ID,
    parent_id
    VALUES (
    A.ID,
    A.PARENT_ID)
    LOG ERRORS INTO err$_fkv;
    1 rows merged.
    Cannot belive, running SELECT for confirmation:
    SELECT * FROM err$_fkv;                    
    SELECT * FROM fkv;
    no rows selected
    ID PARENT_ID
    1 1
    2 2
    Ok, COMMIT:
    COMMIT;
    commited.
    SELECT for confirmation again:
    SELECT * FROM err$_fkv;                    
    SELECT * FROM fkv;
    no rows selected
    ID PARENT_ID
    1 1
    2 2
    Using deffered constraint and error logging is working well too.
    Metalink and Google did not help me. I am using databases 10.2.0.5 and 11.2.0.3.
    Has somebody encountered this problem too or have I missed something?
    Thank you
    D.

    drop table fkv;
    CREATE TABLE fkv (
    id NUMBER(1) CONSTRAINT nn_fkv_id NOT NULL,
    parent_id NUMBER(1) CONSTRAINT nn_fkv_paid NOT NULL
    CREATE INDEX PK_FKV_ID ON FKV(ID);
    ALTER TABLE fkv ADD CONSTRAINT pk_fkv_id PRIMARY KEY (id);
    ALTER TABLE FKV ADD CONSTRAINT FK_FKV_PAID FOREIGN KEY (PARENT_ID) REFERENCES FKV(ID);Now run your MERGE statement and it works with non deferrable constraints.
    Personally, I would contact support about this before depending on it in production.
    P.S. I was not able to reproduce your findings that dropping and re-adding the constraints changes things. I suspect that when you dropped the constraint the index was NOT dropped, so you kept a non-unique index.
    Try again using ALTER TABLE FKV DROP CONSTRAINT PK_FKV_ID drop index;

  • EJB-QL with self referencing cmr-field in path identifier fails

    I have a simple application . Only one bean and one relationship. The relationship is a (0..1)-(0..1) for the same bean (self referencing).
    I have a finder method defined with ejb-ql that tries to access the field of one of the cmr fields of the relationship.
    class1Bean is the abstract schema for my bean, and subclass1 is the cmr-field name.
    SELECT OBJECT(obj) FROM class1Bean obj WHERE obj.subclass1.id LIKE ?1
    Here is the error message when trying to deploy:
    Bean: Class1
    Method: java.util.Collection findBySubclass1(java.lang.String)
    EJBQL: SELECT OBJECT(obj) FROM class1Bean obj WHERE obj.subclass1.id LIKE ?1
    Error: JDO75100: Fatal internal error: JDO75341: Missing field meta data for field 'subclass1' of 'Class1'
    This same code deploys fine on JBoss 4.0, and should be legal ejb-ql. Is this a known issue with Sun JSAS?

    Sounds like a problem with the bean metadata. Please check the entity mapping defined in sun-cmp-mappings.xml. Also make sure field sublass1 is defined as CMR everywhere.
    -- markus.

  • Self referencing VO in an ADF Tree

    Hi @all
    i want to create an ADF Tree and found the following helpful example:
    ADF Code Corner sample #32 show how to build a tree table from a self referencing VO:
    [http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples]
    But i still have two questions:
    1. How can i concatenate two attributes in the View Instance?
    Table looks like
    ID ParentID OrderNo ShortText
    ====================
    1 (null) 10 Text1
    2 1 20 Text2
    3 2 30 Text3
    4 1 50 Text4
    The result should be 10.20.30.
    2. For the first tree-level the change of the ShortText attribut works fine:
    OrderNo: 10 -> Text1
    OrderNo: 50 -> Text4
    (Tree->SelectionListener: #{bindings.WicNodeView1.treeModel.makeCurrent}
    RichTextEditor -> partialTrigger: t1 (the Tree))
    But not for the Sub-Levels:
    The Problem is OrderNo 30 shows also Text1 (and not Text3).
    Do i have to write a method (bean) for the Selection Listener or is there another (shorter) way (i am using Oracle JDeveloper 11.1.2.1.0)?
    Thanks for your help!
    Gregor

    Hi,
    this should work the same. You create a tree from a POJO Data Control based on your POJO Model. Expose another collection pointing to the same data set and drag it as the form. Use the setting on the tree configuration dialog to set the current row in the tree as the current in the form iterator.
    Frank

  • Self Referencing Tables...

    I have a self-referencing table (a Topic can be a response to another Topic) and read one of Frank Nimphius' blogs on this subject, posted on the ADF board for advise. As a result I created the read-only ViewObject to set up this tree relationship and set it to be exposed to the App Module.
    Do I need to do more to it than that for JHeadstart to generate the right page defs? Any advise on setting this up cleanly? My user interface must present a page in which users can post new Topics, view topics in a heirarchy (response thread, like in this forum) and respond to Topics or responses. A response is a Topic that references another (parent) Topic. I have to believe this has been done before a million times but am not sure myself how to do it.
    Thanks!

    Steve,
    I've read the section and am getting this error:
    (oracle.jbo.SQLStmtException) JBO-27122: SQL error during statement preparation. Statement: SELECT Topic.SUBJECT, Topic.ROW_ID, Status.STATUS_CHOICE, Status.ROW_ID AS ROW_ID11, Topic.CREATED_BY, Topic.CREATION_DATE, Response.SUBJECT AS SUBJECT1, Response.CREATION_DATE AS CREATION_DATE1, Response.ROW_ID AS ROW_ID12, Response.CREATED_BY AS CREATED_BY1 FROM TOPIC Topic, RESPONSE Response, STATUS Status WHERE (Topic.ROW_ID = Response.MASTER_ID (+)) AND (Topic.TOPIC_STATUS_ID = Status.ROW_ID) CONNECT BY PRIOR Topic.ROW_ID = Response.MASTER_ID (+) OR Response.ROW_ID = Response.MASTER_ID (+) ORDER BY SUBJECT,CREATION_DATE1
    ----- LEVEL 1: DETAIL 0 -----
    (java.sql.SQLException) ORA-01436: CONNECT BY loop in user data
    I have a table called Topic with a Pk called ROW_ID and another table called Response with a Pk called ROW_ID and an Fk called MASTER_ID. A Topic can have many Responses and a Response can also have many Responses. The parent ID could point to either a Topic or a Response. There's no limit on how many levels this can continue. There's a Status table also from which I want to show the text value of the Status for the Topic row (not the Status ROW_ID)
    I have a View Object including entities: Topic, Response & Status
    I tried the SQL query as:
    (Topic.ROW_ID = Response.MASTER_ID (+)) AND (Topic.TOPIC_STATUS_ID = Status.ROW_ID) CONNECT BY PRIOR Topic.ROW_ID = Response.MASTER_ID (+) OR Response.ROW_ID = Response.MASTER_ID (+)
    Hoping to have this result:
    Topic A
    -Response A (to Topic A)
    --Response B (to A)
    ---Response C (to B)
    -Response D (to Topic A)
    Topic B
    Topic C
    What am I doing wrong?
    Is there a guide that explains better using JHeadstart with JDeveloper (rather than Oracle Designer, which we don't use)? The developer's guide for JHeadstart is hard to translate for use with JDeveloper...
    Thanks!!

Maybe you are looking for

  • Error message when opening itunes...please help

    I recently tried to purchase music on the itunes store, and was told to do so I had to upgrade to itunes 7, which i had put off for quite a while...however, now that I have done so, I get a error that comes up each time I open iTunes, telling me a ne

  • Black and gray box keeps popping up on my monitor and I cant get it to stay off

    Black and gray box pops up on my monitor. Cant move my mouse over it. Cant remove it. It just recently started doing this. I know it has to do with the settings on my monitor, but im not sure how to set it. When I tried, it would go off for a few min

  • How to duplicate a node along with its children in a JTree?

    Hello, Can anyone tell me how to duplicate/create a copy of a node along with its children? Code snippets will be appreciated. Thank you.

  • Variable Offset for Fiscal Year Not Working

    Hello, My fiscal year variable offsets are not working. I have an input-ready query setup with 3 restricted key figures. 1) Restricted by FY Variable 0P_FYEAR, 0VTYPE = 20, KF = 0QUANTITY 2) Restricted by FY Variable 0P_FYEAR (variable offset -1), 0V

  • Max size of a group in Address Book?

    Can any one advise me please what is the maximum or recommended maximum size (ie number of addresses) for an Address Book group that is going to be used to send an email? Thanks