From: Chandrashekara K A (JIRA) <no...@at...> - 2006-05-17 09:02:14
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1758?page=all ] Chandrashekara K A updated HHH-1758: ------------------------------------ Attachment: 1758.patch Code changes : in patch format > auto-import attribute on class entity of the XML mapping document > ----------------------------------------------------------------- > > Key: HHH-1758 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1758 > Project: Hibernate3 > Type: Improvement > Components: core > Versions: 3.0.5 > Environment: Any > Reporter: Chandrashekara K A > Attachments: 1758.patch > > Original Estimate: 0 minutes > Remaining: 0 minutes > > Its nice if the auto-import attribute was supported on the class tag of the hibernate mapping file so that any mapping level autro-import specification can be overridden by a class. Its also quite useful to limit the problem of having to specify the class name completely in querties only to a select set of classes. (Of course any code generation tools like xdoclet must be modified to support this to be very useful - I have done that for our project). > I have attached the changes to class HbmBinder (around line 541 to code that says) > ----------CODE BEFORE-------------- > if(mappings.isAutoImport() && entity.getEntityName().indexOf( '.' ) > 0) { > mappings.addImport( entity.getEntityName(), StringHelper.unqualify( entity > .getEntityName() ) ); > } > -------------------------------------- > ----------CODE AFTER---------------- > boolean unqualify = mappings.isAutoImport() && entity.getEntityName().indexOf( '.' ) > 0; > > Attribute autoImportNode = node.attribute("auto-import"); > > if(autoImportNode != null) > { > unqualify = autoImportNode.getValue().equalsIgnoreCase("true"); > } > > if(unqualify) { > mappings.addImport( entity.getEntityName(), StringHelper.unqualify( entity > .getEntityName() ) ); > } > --------------------------------------- -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |