Update of 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-hibernate/src/main/java/org/xdoclet/plugin/hibernate
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29391/src/main/java/org/xdoclet/plugin/hibernate

Modified Files:
        HibernateMappingPlugin.java 
Log Message:
fix for XDP-122. Only explicit access specification is honored, as well as 
implicit field
access unless overriden


Index: HibernateMappingPlugin.java
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-hibernate/src/main/java/org/xdoclet/plugin/hibernate/HibernateMappingPlugin.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** HibernateMappingPlugin.java 17 Sep 2005 15:57:41 -0000      1.51
--- HibernateMappingPlugin.java 4 Jan 2006 10:19:59 -0000       1.52
***************
*** 426,431 ****
          for (int i = 0; i < beanProperties.length; i++) {
              // property is ours, if we have at least one of designated 
property
!             // tags
!             // and there is accessor
              if ((beanProperties[i] != null) && 
(beanProperties[i].getAccessor() != null) &&
                      !getTags(beanProperties[i].getAccessor(), 
requieredTags).isEmpty()) {
--- 426,431 ----
          for (int i = 0; i < beanProperties.length; i++) {
              // property is ours, if we have at least one of designated 
property
!             // tags and there is accessor
!               
              if ((beanProperties[i] != null) && 
(beanProperties[i].getAccessor() != null) &&
                      !getTags(beanProperties[i].getAccessor(), 
requieredTags).isEmpty()) {
***************
*** 433,441 ****
                  property.setName(beanProperties[i].getName());
                  property.setEntity(beanProperties[i].getAccessor());
!                 
if("field".equals(((DocletTag)getTags(beanProperties[i].getAccessor(),requieredTags).get(0)).getNamedParameter("access")))
 {
!                       property.setAccess("field");
!                 } else {
!                       property.setAccess("method");
!                 }
                  if (!accumulate.contains(property)) {
                      accumulate.add(property);
--- 433,442 ----
                  property.setName(beanProperties[i].getName());
                  property.setEntity(beanProperties[i].getAccessor());
!                 // we do not specify access setting unless there is explicit
!                 // setting
!                 
if(((DocletTag)getTags(beanProperties[i].getAccessor(),requieredTags).get(0)).getNamedParameter("access")!=
 null) {
!                       
property.setAccess(((DocletTag)getTags(beanProperties[i].getAccessor(),requieredTags).get(0)).getNamedParameter("access"));
!                 } 
!                 
                  if (!accumulate.contains(property)) {
                      accumulate.add(property);
***************
*** 451,456 ****
                  property.setName(fields[i].getName());
                  property.setEntity(fields[i]);
!                 if("method".equals(((DocletTag)getTags(fields[i], 
requieredTags).get(0)).getNamedParameter("access"))) {
!                       property.setAccess("method");
                  } else {
                        property.setAccess("field");
--- 452,460 ----
                  property.setName(fields[i].getName());
                  property.setEntity(fields[i]);
!                 // if no property access is specified, we shall use field
!                 // else take whatever  user says ( leave it to his discretion 
to 
!                 // use  wrong specification ) 
!                 if(((DocletTag)getTags(fields[i], 
requieredTags).get(0)).getNamedParameter("access") != null) {
!                       property.setAccess(((DocletTag)getTags(fields[i], 
requieredTags).get(0)).getNamedParameter("access"));
                  } else {
                        property.setAccess("field");



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits

Reply via email to