Embeddable with One To Many?

Hello All,
Is it possible to keep a OneToMany relationship from within an @Embeddable class. Exemple:
@Embeddable
public class X{
    private List<Customer> customers;
@Entity
public class Y{
   @Id
   private int id;
   @Embedded
   private X x;
}Thank you in advance!

Hi C_Walker,
Thank you for your reply. I meant to make X as an @Ebeddable so that I can reuse it in other classes, not that I meant it to have it's own table. So it means that I can only have simple fields and will never be able to do any kind of association, e.g
@Embedable
public class Address{
      @OneToOne
      City city;
      @OneToOne
      States
}So the above is illegal, and we should you only basic fields, right?
Thanks very much

Similar Messages

  • SSAS 2008 snowflake - dimensions with one-to-many relationship (NOT fact table) and hierarchy?

    Hi, below is my data model for SSAS 2008 on snowflake schema.
    Below is SQL Server DW tables:
    DimStudent - StudentID [primarykey], StudentName, DateOfBirth, AddressID
    DimStudentAddresses - AddressID [primarykey], StudentID [foreignkey], ddressLine1, AddressLine2, AddressType
    FactEnrolment - StudentID, EnrolWeek, EnrolFees
    So here FactEnrolement.StudentID is joined to DimStudent.StudentID column,
    and relationship between DimStudent & DimeStudentAddresses is one to many I.e. one student can have multiple addresses like primary or secondry address.
    To design snowflake schema in SSAS 2008 BIDS project :
     [Question-1] how to join one-to-many dimensions (NOT fact table) Like DimStudent & DimAddresses?
     [Question-2] At the end I want to have a single dimension only I.e. Student which should have both DimStudent & DimStudentAddresses tables attributes init. So I can create hierarchy from these two table into a single dimension? How
    to do this?
    Please reply with feedback particular to my above scenario as I refereed other MSDN forums but nothing solid I found.
    Any STEP-BY-STEP guideline please. Many thanks.

    Hello KM,
    Have you solved this issue after refer to Bill's suggestion? Please let us know how things go.
    If you have any feedback on our support, please click
    here.
    Best Regards,
    Elvis Long
    TechNet Community Support

  • Controlling Delete Order with One-To-Many

    I have a class that has six 1-M mappings. All of them have a 1-1 back reference. I would like to control the order of deletion to ensure that one of the child collections is always deleted last.
    It was suggested to me to use an after-load method to call addConstraintDependencies on the parent descriptor to control the order. This method is being called (before login) but it did not change the order. I added the after-load to the parent descriptor, adding the constraint dependency of the class I want deleted last.
    I also tried using "multi-table info" (in addition to the regular one-to-many mappings) but that seems to cause the valueHolder to retrieve the items from the table twice, giving me a list with "doubles" of every item.
    What can I do to control the order of the deletes of the children?
    Thanks,
    Allen

    Hi Don,
    This is with reference to your comments on the following oracel forum query "http://forums.oracle.com/forums/thread.jspa?messageID=508819&#55728;&#57235;" regarding 1:M mapping insertion problem.(Same one)
    Actually I also have the same kind of scenario but the data in not getting inserted to the detail table. It always gives ORA-1400 error as it is unable to populate the foreign key of parent in child table.
    Can you suggest if I am missing something.
    Your quick response will be appreciated.
    Message was edited by:
    user466708

  • TopLink11 Tutorial problems with one-to-many relation

    Hi,
    I installed TopLink 11 and the related tutorial to work in a simple Eclipse project.
    Everthing works fine except for the storing of the one-to-many relation in the database.
    The tutorial works with employee, address and phone tables/classes. Plain Objects can be stored and one-to-one relations too. However when trying to store a one-to-many relation not the key of the related object (which is at that tome well known) but the object is tried to be entered
    in the Logfile I find:
    [TopLink Fine]: 2008.01.10 10:27:28.748--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--INSERT INTO EMPLOYEE (EMP_ID, L_NAME, F_NAME, ADDR_ID, VERSION) VALUES (?, ?, ?, ?, ?)
         bind => [1501, Pascal, Blaise, 2252, 1]
    [TopLink Finer]: 2008.01.10 10:27:28.748--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--commit transaction
    [TopLink Finer]: 2008.01.10 10:27:28.748--UnitOfWork(14858725)--Thread(Thread[main,5,main])--end unit of work commit
    [TopLink Finer]: 2008.01.10 10:27:28.748--UnitOfWork(14858725)--Thread(Thread[main,5,main])--release unit of work
    [TopLink Finer]: 2008.01.10 10:27:28.748--UnitOfWork(14858725)--Thread(Thread[main,5,main])--release unit of work
    [TopLink Finest]: 2008.01.10 10:27:28.748--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Register the object Employee: Blaise Pascal
    [TopLink Finest]: 2008.01.10 10:27:28.748--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Execute query DoesExistQuery()
    [TopLink Finer]: 2008.01.10 10:28:58.370--UnitOfWork(18511661)--Thread(Thread[main,5,main])--begin unit of work commit
    [TopLink Finer]: 2008.01.10 10:28:58.370--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--begin transaction
    [TopLink Finest]: 2008.01.10 10:28:58.370--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Execute query UpdateObjectQuery(Employee: Blaise Pascal)
    [TopLink Finest]: 2008.01.10 10:28:58.386--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Execute query InsertObjectQuery(PhoneNumber[desk]: (603) 123-4567)
    [TopLink Fine]: 2008.01.10 10:28:58.386--DatabaseSessionImpl(12916846)--Connection(9550256)--Thread(Thread[main,5,main])--INSERT INTO PHONE (P_NUMBER, EMP_ID, AREA_CODE, TYPE) VALUES (?, ?, ?, ?)
         bind => [1234567, {Employee: Blaise Pascal}, 603, desk]
    [TopLink Warning]: 2008.01.10 10:28:58.511--UnitOfWork(18511661)--Thread(Thread[main,5,main])--Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 3 (11.1.1.0.0) (Build 071214)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Ungültiger Spaltentyp Error Code: 17004
    the highlighted section should be 1501 (the key of the employee record)
    Any ideas how to fix this?
    Thanks Erika

    Erika,
    You need to specify the other side of the relationship (on the PhoneNumber side), which is done by putting a @ManyToOne annotation on the "employee" attribute in PhoneNumber. That will cause TopLink to know that it is a relationship and not a basic mapping.
    -Mike

  • Help with One to Many Formula

    Post Author: Don
    CA Forum: Formula
    Hello Everyone,
    I need some assistance.  I have a one to many relationship...
    Example...
    TABLE 1
    FieldName = RecordID
    DATA, RecordID= 10
    TABLE 2, linked one to many to RecordID in TABLE1
    FieldNames = RecordID, Name, ContactType
    DATA, RecordID= 10, Name= Tom, ContactType= Sales
    DATA, RecordID= 10, Name= Dan, ContactType= Service
    DATA, RecordID=10, Name= Jon, ContactType= Sales
    What I am looking for is to create a formula that would return something that looks like this....
    Sales Contact Name
    Tom, Jon
    So... I want to grab all the "Contact Types" of "Sales" from TABLE 2 then pass in the "Name" field from TABLE 2 and if there is more then one "Name" of the sames "Contact Type" then comma seperate it.
    And...  I don't want to do this in a sub report.   I do know I can make a sub report and return both values but to my knowledge the values would be on top of one another and not beside each other comma separated.
    Ideas?

    Post Author: Don
    CA Forum: Formula
    That may work using a subreport...
    I think the root of this my problem is the fact I have a table relationship, left outer... one to many join.  So even if I drop your suggested formula in my report I still get repeating record details with blank names where all the other contact types would be.
    Ticket Number       Contact Name     Contact Type
    111111                  Dan, Jim               Sales
    111111                                                                 <---- where the other contact type appear
    111111                                                                 <---- where the other contact type appear
    I was trying to avoid having to create several subreports for each data field I need on the report.  However, I think I can use your formula in a subreport to allow the data to display in a comma separated row rather then a vertical list.
    I thought about suppressing but that won't work because I have other contact types I need to list.
    Thank you for responding.

  • Select with One-to-Many and Many-to-One without repeating

    Hi
    I have a customer who needs a report two sides left and right, but allowing for One-to-Many and Many-to-One relationships in the one report.
    A little background:-
    This has do do with listings on land and buildings.
    One building can be built on a few pieces of land.
    Similarly, there can be several buildings on one piece of land.
    What is required is a listing of buildings on the left, land on the right, but without repeating the "single line entries" either left or right.
    For example Building1 is on Land1 and Land2, and Building2 and Building3 are built on Land3.
    We need:-
    Building1 Land1
    ________Land2
    Building2 Land3
    Building3______
    The ___ just used for spacing so you get the idea ;)
    Essentially - a "break by" on columns on the left and right.
    The Buildings and Land are in different tables, with a link table - one row for each link.
    Any ideas?
    Thanks
    Mike

    To jitu.jk - first, this is not in SQL*Plus - its a report in APEX - second, I see no way to break on the left and the right in the same select.
    Maybe there is a way.
    To Etbin
    This is a very inovative solution - I've tried it out and the result is:-
    BUILDING LAND
    _____Land 4
    _____Land 3
    _____Land 5
    Building 2 Land 4
    Building 3 Land 1
    _____Land 4
    Building 4 Land 4
    Building 5 Land 3
    _____Land 4
    (The underscores I put in for spacing - not perfect but you get the idea - hard whe you write the reply in a fixed space font and it's displayed in the forum in variable space font!! ;)
    9 rows selected.
    This is not quite the desired result - in your list of associations, we have Building1 associated with Land 3,4, and 5.
    So for Building 1 we should have:-
    Building 1 Land 3
    ________Land 4
    ________Land 5..........
    But your result doesn't include Building 1 at all.
    The other requirement is that no building or land is ever repeated - so I came up with the concept of "groups".
    Starting with one building - I find all pieces of land that are associated - listing them on the right (without repeating the building.
    I then find any other buildings asociated with any of the land records that the first building was associated with.
    These are listed on the left - without repeating the land records on the right.
    This group is given a unique identifier of the minimum association ID (my associations have ID's).
    This all done, I use the unique ID as a break column ans summarise additional columns (area, value etc) below each group.
    Because of the summaries - adding area and value etc, I can't have any building or land duplicated as I would then "double count" the area, value etc.
    Maybe you method can be made to work with some tweaking.
    Very clever indeed - forums need great answers like this - it keeps us going.
    Thanks again
    Mike

  • Insert with one-to-many mapping

    Hi,
    I've got the following situation:
    - an object A with a vector of object B
    - I defined a one-to-many relation in the descriptor of A referencing a collection of B using indirection through valueHolderInterface, the "private owned" is also checked
    - I defined a one-to-one relation in the descriptor of B referencing the object A using indirection through valueHolderInterface
    - the bidirectional relationship is maintained.
    I try to insert a new object A with a new object B inside. The code is as follows:
    A = new A();
    B = new B();
    // ... set the A attribute values
    // ... set the B attribute values
    A.addB(B);
    UnitOfWork uow = session.acquireUnitOfWork();
    uow.registerNewObject(A);
    uow.commit();
    where addB(b) is as follows:
    ((java.util.Vector)bvector.getValue()).add(b);
    b.setA(this);
    Executing this code, the object A is inserted in the database but the object B is not. And I would like that the object B is also stored in the database. Do I really have to register it? I want to make the insert in just one transaction. Have anyone an idea? I tried a lot of different configurations and just one SQL insert order is generated by Toplink.
    Thanks,
    Frédéric

    Hi Don,
    This is with reference to your comments on the following oracel forum query "http://forums.oracle.com/forums/thread.jspa?messageID=508819&#55728;&#57235;" regarding 1:M mapping insertion problem.(Same one)
    Actually I also have the same kind of scenario but the data in not getting inserted to the detail table. It always gives ORA-1400 error as it is unable to populate the foreign key of parent in child table.
    Can you suggest if I am missing something.
    Your quick response will be appreciated.
    Message was edited by:
    user466708

  • Confused with one to many relationship

    Hi Masters ,
    Reading about one to many : i came across this
    Each row in Table A can have many (zero or more)
    matching rows in Table B but each row in Table B
    has only one matching row in Table A.
    A ZipCode can have many Students but each Student has only
    one ZipCode
    Theoritically this would be fine but can anyone please make tables for the above so i want to see it pratical work.

    zip
    (zipcode varchar2(6)
    , low_street_number varchar2(10)
    , high_street_number varchar2(10)
    , odd_even char(1)
    , city varchar2(30)
    , constraint zip_pk primary key (zipcode)
    student
    (studentno number(10)
    , firstname varchar2(30)
    , lastname varchar2(30)
    , zipcode varchar2(6)
    , constraint zip_fk foreign key(zipcode) references zip_pk
    Sybrand Bakker
    Senior Oracle DBA

  • Move VS Windows App (Access DBS with one to many form)

    I have a VS Windows App (forms connected to an Access DBS-including one to many form) and would like to have users access via our SharePoint 2001 site...
    thank you.
    mjschukas

    Hi mjschukas,
    This forum is to discuss problems of Windows Forms. Your question is related to SharePoint.
    You can consider posting it in sharePoint forum(http://social.technet.microsoft.com/Forums/en-US/home?forum=sharepointdevelopmentprevious)
    for supports. Thanks.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • EJB 2.0 RI, CMR, problem with one-to-many

    I got an entity bean with a one/many, bidirectional, non-cascading relationship to another entity bean. The "one" side is represented by the remote type of the related entity bean.
    The "many" side is represented by the type "java.util.Collection".
    Unfortunately, the Verifier spits out the following error for the "many" side:
    Error : Invalid type assigned for container managed field [ depots ] in bean [ Account ]
    "depots" is defined in AccountEJB.java via the abstract contract
    [import java.util.Collection;]
    public abstract Collection getDepots();
    public abstract void setDepots(Collection depots);
    Q1. Is there anything wrong with this?
    Q2. Does the currect J2EE RI 1.3 beta support CMR as defined in the draft2 of EJB 2.0?
    Q3. Do I need to mark the CMR fields as CMP 2.0 ("fields to be persisted") in the Deployment Tool? I'd say yes, but if I would be picky, CMR would not be CMP...
    Q4. Can anyone point me to a good example of CMR. The PetStore App uses BMP everywhere, and I could not find any other useful demos.
    I'd appreciate any help!
    Greetings,
    Andreas

    I am new to J2SDKEE1.3 CMR. I have similar question about CMR. The only example is the "customer" under the J2SDKEE1.3 doc fold. Can anyone provide more examples?
    Thanks in Advance.
    Oliver

  • Activating multiple iPhones with one or many Apple IDs?

    I'm wondering whether its possible to activate an iPhone with an iTunes Store account that is not the one the phone will be used with. I'm centrally activating a dozen iPhones and loading a configuration profile onto them but I need to know if I'll need to take the staffs Apple ID's off them in order to do that?
    Equally they're all going to be on a company plan but I don't want them to be able to sync their phones and have access to the same account that was used to pay for the contract, otherwise they could go nuts on the company card! (I know there are some safeguards but it only takes one to read the password upside-down off the bosses desk and then...)
    Is it possible to complete an activation without logging into an iTunes Store account and if not then how do you avoid either:
    a) getting all the staff's personal information (and that is not something I would give out to anyone, they could post a silly question!)
    b) giving the staff access to a single company account. I don't even know whether its allowed to activate a dozen phones on one Apple ID
    I have an iPhone myself but I can't remember at what point I had to put in my information and the videos and tutorials I've seen either don't specify or are completely useless (the O2 one is my personal favourite http://shop.o2.co.uk/FAQ?category=iPhone&question=FAQHOW_DO_I_ACTIVATE_MYIPHONE given that you could re-write that whole page as just, "use iTunes")
    Also, am I missing something basic, I thought this would at least be in the Enterprise activation guide as I'm sure I can't be the first one to ask this question?
    Any help/thoughts appreciated

    Ah excellent, so I can activate the phones on the company account and hand them over to each member of staff to sync with their own iTunes accounts. So I'll also be able to get the free apps on the company account and then give them over to the staff to sync with their own iTunes accounts. It means I'll have to update them manually but that's manageable at this scale.
    Does anyone know if the ability to pre-load non-commercial apps is going to be a feature of the configuration utility at any point? Or at least have a post installation script which uses their account to download the apps (with appropriate dialogues requesting permission or whatever) so that you can ensure app deployment without knowing their Apple ID's?
    Must remember to delete that initial text message too, if there is still one, as that'll have the account login details!
    I've already got the iPhone Configuration Utility configured to set them up with Passcodes but I've not applied any restrictions, parental control wise. After all there's no point in having the iPhone if you can't have fun with all the features.
    A second question but related, if you take the iPhone backup file and save it on another machine (having swapped it out for one that may already have been there) and then plug the phone in, will it sync? Does it still work if the phone backup is encrypted?
    I'm thinking of backup solutions and the inevitable hardware failure that'll take the iPhone backup with it. I'll probably be trying to ChronoSync or RSync the User/Home/Library/Application Support/MobileSync/Backup folder to a server location where it'll be rolled into our regular backup procedure but will I be able to restore that backup to another machine, the .../MobileSync/ folder and get the iPhone to work again? How have others handled this?

  • Formatting Issue - datatables with one to many relationship

    Hi...
    I am a newbie and I have designed a report in CR2008 and my datasource for the report is an XSD file. There are 2 tables Table A and B.
    Table A is as follows:
    AID     Name     Reference     Period          Manager
    5       Name 1     Ref 1          July 2009     User Name 1
    8     Name 2     Ref 2          August 2009     User Name 2
    9     Name 3     Ref 3          March 2009     User Name 9
    45     Name 4     Ref 4          May 2008     User Name 4
    88     Name 5     Ref 5          June 2009     User Name 1
    There are other coloumns too in the datatable, but that shouldnt matter.
    Table B is as follows:
    ID     A_ID     DateKey     DateValue          Name
    1     5     Date1     2009-09-29 00:00:00.000     Start Date
    2     5     Date2     2009-08-11 00:00:00.000     Fieldwork Complete
    3     5     Date3     2009-08-14 00:00:00.000     Report Issued
    4     5     Date4     2009-07-17 00:00:00.000     Report Finalised
    5     5     Date5     2009-07-10 00:00:00.000     Close Date
    6     8     Date1     2009-08-11 00:00:00.000     Start Date
    7     8     Date4     2009-09-29 00:00:00.000     Report Finalised
    I want the report to be in the following format:
    ID     Name     Reference     Period     Manager     StartDate     Fieldwork          ReportIssue     Finalised      Closed
    I have written a formula to display the date value where the date key matches for A_ID.
    But when I run the report I get the result as follows:
    ID     Name     Reference     Period     Manager     StartDate     Fieldwork          ReportIssue     Finalised      Closed
    5     Name1     Ref1          July 2009     UName 1     29/09/2009                                   
                                            11/08/2009                                                                                          14/08/2009                                                                                          17/07/2009                                                                                     10/07/2009     

    Hi
    I tried what you suggested, but it hasnt worked.
    In your code, you have used the date ID,
    if {b.id} = 1 then
      formula = {b.datevalue}
    end if
    but the table contains dates from several A_IDs, and I want to get the dates for the respective A_ID, So shouldnt I be matching the A_ID's first? I also dont understand how the max function helps here?
    My report is already grouped by Table A, ID.
    My report should be a join of the two tables, a left outer join to be exact.
    Also, if my XML data contains only one record for Table A, dates still come out in a separate line. I dont quite understand where the problem is?
    Thank you...

  • About inserting with one to many relationship

    db and dev 10g rel2 ,
    hi all ,
    using emp and dept tables of scott/tiger schema .
    if i have a form , how can i insert 4 new employees in a specific dept ? what blocks should i build , and how can the user inserts into these blocks ?
    thanks in advance

    the user should write "20" in the deptno field once , and write the 4 new employees' data .To do this, you create a relationship between the blocks with the Dept block to be the Master and the Emp block to be the detail block. Your Form layout would look something like the following:
    |---------------------------------------|
    | [     ] Department Number             |
    |---------------------------------------|
    | Employee data...                      |
    | [    ] Emp ID                         |
    | [               ] First Name          |
    | ...rest of the columns listed here... |
    |---------------------------------------|Once you have created the relationship, Forms will handle the rest. Just run your form, select department 20 and start adding new employees.
    Craig...

  • ODBC Connection with one to many results

    Hi there - I have followed Stefan Cameron's excellent blogs on linking livecycle forms to data from an odbc connection however I have now become stuck.
    Effectively I have a form that populates part of the form with matching data for a specific id, however I then need to populate a different part of the form from another database connection that holds multiple records for that id.
    I have successfully completed the first part (YEAY!) however the second bit I cannot do - I have tried using the xfa.sourceSet.dataconnection.next() however this repeats the same data and doesn't seem to want to get the next record.
    What I seem to need is a mix of Stefan's "selecting specific records" (which works great for the first bit) then the retrieving ALL records bit from here
    http://forms.stefcameron.com/2006/10/12/displaying-all-records-from-an-odbc-data-connectio n/
    but only where the relation matches the first section.
    Does anyone have any ideas - I'm sorry if I am not being very clear - I can post more detail if needed.
    Regards,
    Bev.

    Thanks Paul - I already have two data connections as there are two different result sets I am working on
    To clairfy - the first data connection retrieves grant id, title name and address of all grants
    The second data connection then retrieves financial data for all projects related to those grants
    There are several records of financial data per grant.
    So the first bit of code retireves all relevant data for the grant selected.
    xfa.sourceSet.claimdata.#command.query.select = concat("SELECT grt_title, grt_contact, grt_org, grt_addr, grt_post FROM gs_user_claim_pdf_table WHERE grt_id = ",sGrtId, ";")
    xfa.sourceSet.claimdata.open()
    xfa.sourceSet.claimdata.first()
    This bit works fine
    The second bit is only working for the first record it finds - what I need to do is to loop through all the results and populate a repeating subform with the relevant results but I just don't know how!
    xfa.sourceSet.subproject.#command.query.commandType = "text"
    xfa.sourceSet.subproject.#command.query.select = concat("SELECT sub_prj_title,claim_amt,tot_est_cost,unit_type,total_units,funded_by,exp_type,grt_id,prj_ id FROM gs_user_sub_proj_table WHERE grt_id = ", sGrtId, ";")
    xfa.sourceSet.subproject.open()
    xfa.sourceSet.subproject.first()
    _subprojects.addInstance(1)
    xfa.sourceSet.subproject.next()
    Any pointers gratefully received!

  • One-to-many with subclasses

    Hello again,
    there seems to be a problem with one-to-many relations involving
    inheritence...
    Let me describe the setting:
    class AbstractUsecase {
    // element-type=Account
    Set accounts;
    class Usecase extends AbstractUsecase {
    class Account extends AbstractAccount implements InstanceCallbacks {
    // element-type=AccountRevisionItem
    List revisions;
    AbstractUsecase uc;
    class AccountRevisionItem extends Account {
    long time;
    User user;
    As you can see a simple model (in uml it looks much more better).
    In the method jdoPreStore() of Account an object of type
    AccountRevisionItem will added to revisions. This new object holds the
    data of Account, the User and timestamp of the modifing. So we are able to
    trace every change on the date (user, date). Metadata looks like this:
    <class name="AbstractUsecase"/>
    <class name="Usecase" persistence-capable-superclass="AbstractUsecase">
    <class name="Abstractaccount"/>
    <class name="Account" persistence-capable-superclass="AbstractAccount">
    <extension vendor-name="kodo" key="table" value="Account"/>
    <field name="revisions">
    <collection element-type="AccountRevisionItem"/>
    </field>
    </class>
    <class name="AccountRevisionItem"
    persistence-capable-superclass="Account"/>
    When i get a extent of all Accounts i can fetch all revisions of each
    Account.
    Now the problem: When i fetch all accounts of a usecase there are objects
    included of type Account AND AccountRevisionItem. The generated SQL code
    shows also why: ...t0.JDOCLASSX IN ('tolina.data.Account',
    'tolina.data.AccountRevisionItem')...
    Kodo tries when fetching a set of Accounts also all subclasses of
    Accounts! How can i say: this set contains only accounts and no fetching
    of subclasses is needed!
    I would be grateful for any help!
    PS: I noticed that kodo deletes all elements of a list when inserting a
    new element, i remember there a several faqs around this. Can you anyway
    give a work-a-round?

    Hi Patrick,
    i found my mistake: in the copy() method of AccountRevisionItem which
    copies the attributes of the Accountobject, i copied the Usecase reference
    too.
    So when all Accounts of a usecase will be fetched the copied
    AccountRevisionItem matched too, because of the fk of the usecase :[
    I was wondering why i get the RevisionItem although i never added it to
    the list of accounts in the usecase - now i know :)
    Your strategy to fetch all objects of the desired class AND subclass when
    traverse a relation is of course right. But can i control it like in the
    case from extents?
    Your proposal to use sets instead of lists is not really the solution,
    because sets have no order of the containing elements!
    I have to life with sets because deleting all elements when inserting a
    new one is not really performant...
    Thanks anyway for your quick help!
    I promise this was not the last time, because we will use kodo in a
    prototyp-project - when it will be a success we will buy kodo.
    Patrick Linskey wrote:
    How are you getting the extent? If you do:
    Extent e = pm.getExtent (Account.class, true);
    you will get all subclasses. If you do:
    Extent e = pm.getExtent (Account.class, false);
    then you will get an extent of just Account objects -- no subclasses.
    Now, if you're traversing a relation, we will always return all objects
    in that relation, regardless of subclass. So, if you have a one-many
    relation from UseCase to Account, we'll return all objects in that
    relation. However, that relation should only contain data that you put
    into it, so if you never put anything but Account objects into it, then
    you should not see anything else come out.
    Regarding your collection question -- if you declare the field as a
    java.util.Set, modifications of the collection will be much more efficient.
    -Patrick
    Claudius Gr__ver wrote:
    Hello again,
    there seems to be a problem with one-to-many relations involving
    inheritence...
    Let me describe the setting:
    class AbstractUsecase {
    // element-type=Account
    Set accounts;
    class Usecase extends AbstractUsecase {
    class Account extends AbstractAccount implements InstanceCallbacks {
    // element-type=AccountRevisionItem
    List revisions;
    AbstractUsecase uc;
    class AccountRevisionItem extends Account {
    long time;
    User user;
    As you can see a simple model (in uml it looks much more better).
    In the method jdoPreStore() of Account an object of type
    AccountRevisionItem will added to revisions. This new object holds the
    data of Account, the User and timestamp of the modifing. So we are able to
    trace every change on the date (user, date). Metadata looks like this:
    When i get a extent of all Accounts i can fetch all revisions of each
    Account.
    Now the problem: When i fetch all accounts of a usecase there are objects
    included of type Account AND AccountRevisionItem. The generated SQL code
    shows also why: ...t0.JDOCLASSX IN ('tolina.data.Account',
    'tolina.data.AccountRevisionItem')...
    Kodo tries when fetching a set of Accounts also all subclasses of
    Accounts! How can i say: this set contains only accounts and no fetching
    of subclasses is needed!
    I would be grateful for any help!
    PS: I noticed that kodo deletes all elements of a list when inserting a
    new element, i remember there a several faqs around this. Can you anyway
    give a work-a-round?
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

Maybe you are looking for

  • Problem with alv filter

    Hi all, I have a problem when i filter ALV column, which has data type  BELNR (FI doc No). I input in filter FI doc: 40000007 (8 char long, w/o zero ahead), then i get the empty result. The really one i want to get is a ALV line with FI doc = '400000

  • My I phone 4s (I think) won't charge or turn on  Please help!

    I have tried holding the 2 buttons to reset and nothing happens. The phone was on charge all night and only showed 1% battery so I turned it off and now it is non responsive. Please help!

  • Syncing Back From MMe to iPhoto

    I have created and shared a gallery on mobile me. I want to allow others to add to it but do not want the new photos synced back to my iPhoto (only to appear in the MMe gallery). Is there any way to do this? Thanks in advance

  • Search Engine (Freeware)

    Is there any search engine (FREEWARE) for Oracle Form and Reports to global search a string among forms and reports in a folder. I'm using Forms Mate trail version and it is restricted to search among only 5 forms. Any suggestion?

  • Breadcrumb Navigation Redirects to Webpage

    I can get access to iTunesU as Administrator using the Perl script provided on Apple's site. However, when I create levels of courses and welcome screens, I am having problems navigating using the breadcrumb buttons on top. When I press the second bu