facebook

Generating m2o mappings and fixing map errors

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

    vsnoone
    Member

    I was wondering why whne generating <many-to-one> mappings the plugin only uses the table name as the value for the “name” attribute? This seems to cause variable names of var, var1, var2 to be present in the code. Why not just use the column name or the table+column name? Also, if there are compile errors within the POJO generated files what is the reccomended approach for fixing them?

    Thanks
    J

    #227546 Reply

    support-jeff
    Member

    Just cuz! 😉 Seriously, it is next to impossible to intuit the intent of the database schema, so I settled on the table name and numbers to distinguish. The dual POJO class generation lets you add clarifying names/methods in the subclass – that only gets generated once and never overwritten, so it is safe to do whatever you want there.

    As for compile errors in the generated files, what errors – need more to go on here. There should not be (unless there is a dependent class in your model that you have not generated yet). Could you post the generated code and mark the statements that are not compiling? Please also post the mapping file for the class.

    #227601 Reply

    vsnoone
    Member

    okay, before I tackle the compile question I have a more burning issue. The databse contains about 1200 tables :). When I highlight all 1300 tables to generate hibernate files and pojos for not all of them contain <id> or <composite-id> elements though Oracle em and MyEclipse Database Explorer show the primarys keys are there. To verify I tried to map one of the tables that did not show the <id> elements and of course mapping this by itself worked. Hence the <id> field did show up. It seems that the plugin is has a limitation on how many tables it can map at one time or at least hoe many <id> and <id-composite> elements can be generated at within a single run. Mapping files and pojos wher created for all but not all mapping files containes <id> elemetns thought the schema denotes they do. I have mapped all 1300 tables by breaking it down into small batch.

    I will reply again later today about the compile errors. It seems the hinbernate pluging duplicates member variables for association. I want to wait before continue with this because I want to see what happens after back the creation process.

    Thanks
    J

    #227617 Reply

    vsnoone
    Member

    Okay, It seems that when the Hibernate plugin tries to map 1300 tables it gets confused or something. Again the plugin does map all tables but does not provide a <id> or <id-composite> key for all of the them. From what I can tell the plugin stops generating id at some point. I think the duplicate association are caused by me having to make multiple runs in order to generate the mapping for all 1300 tables. Any help would great!

    Thanks
    J

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Generating m2o mappings and fixing map errors

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