facebook

Hibernate generation error

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #236807 Reply

    madisonDave
    Member

    Hi

    I have a database connection. I have added the Hibernate components. I right click on the table I want a Hibernate mapping to and I get this error:

    The content of element type “class” must match “(meta*,subselect?,cache?,synchronize*,comment?,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array|query-list)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*)”.

    The XML file says not to edit it manually. What is this error from?

    Thanks

    David

    #236810 Reply

    madisonDave
    Member

    Per the posting guidelines
    OS

    Windows 2000 5.00.2195
    Service Pack 4

    Eclipse

    Versoin 3.1.0
    Build id: I20050627-1435
    Fresh Install for testing MyEclipse

    Java

    j2sdk1.4.2_05

    David

    #236811 Reply

    madisonDave
    Member

    I am using the JDBC ODBC Bridge to connect to an Access database for testing.

    #237337 Reply

    Allan L Brooks
    Participant

    This message has not been recovered.

    #237346 Reply

    Brian Fernandes
    Moderator

    David,

    I’m sorry we seem to have missed your post. Are you still experiencing that error?
    Also, I need you to clarify a bit further –

    I right click on the table I want a Hibernate mapping to and I get this error:
    The content of element type “class” must match

    When exactly do you see this error. I suspect the mapping file is generated in the location you specify and the error is a validation error you see when you attempt to edit the file? Please correct me if I’m mistaken.

    Since you are using Acess, when you expand your table in the DB Browser view, do you see your Primary Key columns decorated with Primary Key icons?

    allbrooks,

    Could you post all your details just like David did above? Are you saying it works for your tables sometimes, but does not work for the same tables at other times (but works when you close and open the DB connection?)
    Can you see any relevant errors in your error log when it does not work for you and paste them here please?

    Bests,
    Brian.

    #237372 Reply

    Allan L Brooks
    Participant

    OS

    Windows XP
    Service Pack 2

    Eclipse

    Version 3.1.0
    Build id: I20050627-1435

    This is the only plugin I have installed on this version ( I have regular eclipse and myeclipse seperated

    It does give me validation errors because the ID key is missing so I go back to DB close then open the same connection and regenerate the files…the IDs do appear after that. The duplicated field names appear in the java code..the XML has duplicated the field names in the mapping file. Not sure what is going on there. I will do a bit more research on that when I get time but I do have to manually modify the mapping file.

    I will be starting a subscription for my eclipse as I really like the environment and some of the features. The DB tools are really helpful for oracle.

    Let me know if you need anything else,

    Allan

    #237401 Reply

    0wen
    Member

    I had the same error and it turned out to be due to exceeding the MAX_OPEN_CURSORS limit on my Oracle 9 database. Check your eclipse log and see if there are any errors

    #237425 Reply

    Brian Fernandes
    Moderator

    Allan,

    I assume you’re using Oracle (which version exactly) and the thin client driver to connect? (ojdbc14.jar)?
    Also, please mention your MyEclipse version and build ID.

    As treilly suggests, do check your logs to see any errors that were reported. The behaviour that you are describing is quite odd.
    Your log is located at <workspace-folder>/.metadata/.log

    Another question, are the missing IDs and the duplication errors separate? In other words, when you reopen your connection and the IDs are generated fine, do you still see duplication in your java and mapping XML files?

    Finally, thank you for the compilment and your support :),

    Best
    Brian.

    #237550 Reply

    Allan L Brooks
    Participant

    Yes thanks that was a problem with to many open cursors but please make sure you the resultsets are getting closed. I bumped ours up to 500 so I can do a few more at a time. The version of Oracle is 10.2.1 and you are correct in the name of the jar file. The duplicates problem may be part of the same problem but I will have to go back to those specific tables and regenerate to find out. I finally have got them all done and its actually closer to 700- 800 tables.

    Just an idea to maybe make that functionality as an ant task so people can just start the process and go about doing other business. I may use middlegen (ant task) to do that but they dont appear to be updating that any longer.

    Thanks the your other user for the answer I was looking for,

    I will let you know what I find about the duplicate problem

    #237553 Reply

    Brian Fernandes
    Moderator

    Allan,

    Glad you resolved that issue – we would appreciate your findings on the duplication issue whenever you find the time.

    Also, we do take special care to close our cursors, but a few code locations may have holes in them. Could you give me an idea of how you were using the DB Explorer? Just expanding tables and generating Hibernate Mappings or were you running queries as well, or something else? This will help us narrow down the areas which need to be investigated for faulty cursor management.

    We do understand it is a task to generate hibernate mappings for many tables all at once, and we will be looking at enhancing this aspect in the next release.

    Thanks for the support and feedback,

    Best,
    Brian.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Hibernate generation error

You must be logged in to post in the forum log in