[jboss-cvs] jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch ...

Max Rydahl Andersen mandersen at jboss.com
Mon Aug 14 19:14:31 EDT 2006


  User: mandersen
  Date: 06/08/14 19:14:31

  Modified:    hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch     
                        CodeGenerationSettings.java ExporterAttributes.java
                        CodeGenerationLaunchDelegate.java
                        AddPropertyDialog.java
                        HibernateLaunchConstants.java
  Log:
  updated core libs
  updated test libs and acutal test code
  added/fixed property settings per exporter
  exposed many-to-many and optimistic lock in ui
  
  Revision  Changes    Path
  1.10      +23 -6     jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettings.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CodeGenerationSettings.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettings.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- CodeGenerationSettings.java	7 Jul 2006 13:51:08 -0000	1.9
  +++ CodeGenerationSettings.java	14 Aug 2006 23:14:31 -0000	1.10
  @@ -78,6 +78,8 @@
       private StringDialogField packageName;
   
       private SelectionButtonDialogField preferRawCompositeIds;
  +    private SelectionButtonDialogField autoVersioning;
  +    private SelectionButtonDialogField autoManyToMany;
   
       private SelectionButtonDialogField useOwnTemplates;
       private StringButtonDialogField templatedir;
  @@ -213,8 +215,18 @@
           preferRawCompositeIds.setSelection(true);
           preferRawCompositeIds.setDialogFieldListener(fieldlistener);
           
  +        autoManyToMany = new SelectionButtonDialogField(SWT.CHECK);
  +        autoManyToMany.setLabelText("Detect many-to-many tables");
  +        autoManyToMany.setSelection(true);
  +        autoManyToMany.setDialogFieldListener(fieldlistener);
  +        
  +        autoVersioning = new SelectionButtonDialogField(SWT.CHECK);
  +        autoVersioning.setLabelText("Dectect optimistic lock columns");
  +        autoVersioning.setSelection(true);
  +        autoVersioning.setDialogFieldListener(fieldlistener);
  +        
   		useOwnTemplates.attachDialogField(templatedir);
  -        reverseengineer.attachDialogFields(new DialogField[] { packageName, preferRawCompositeIds, reverseEngineeringSettings, reverseEngineeringStrategy });
  +        reverseengineer.attachDialogFields(new DialogField[] { packageName, preferRawCompositeIds, reverseEngineeringSettings, reverseEngineeringStrategy, autoManyToMany, autoVersioning });
          
   		consoleConfigurationName.doFillIntoGrid(container, 3);
   		Control[] controls = outputdir.doFillIntoGrid(container, 3);
  @@ -228,6 +240,9 @@
           fillLabel(container);
           preferRawCompositeIds.doFillIntoGrid(container, 2);
   		fillLabel(container);
  +        autoVersioning.doFillIntoGrid(container, 2);
  +        fillLabel(container);
  +        autoManyToMany.doFillIntoGrid(container, 2);
           useOwnTemplates.doFillIntoGrid(container, 3);
           controls = templatedir.doFillIntoGrid(container, 3);
           // Hack to tell the text field to stretch!
  @@ -385,9 +400,6 @@
             return packageName.getText();
       }
   
  -    public boolean isPreferBasicCompositeIds() {
  -        return preferRawCompositeIds.isSelected();
  -    }
   
   	private IPath getReverseEngineeringSettingsFile() {
   		return pathOrNull(reverseEngineeringSettings.getText() );
  @@ -410,6 +422,8 @@
              ExporterAttributes attributes = new ExporterAttributes(configuration);
              consoleConfigurationName.setText(attributes.getConsoleConfigurationName());
              preferRawCompositeIds.setSelection(attributes.isPreferBasicCompositeIds());
  +           autoManyToMany.setSelection( attributes.detectManyToMany() );
  +           autoVersioning.setSelection( attributes.detectOptimisticLock() );
              outputdir.setText(safeText(attributes.getOutputPath()));
              reverseengineer.setSelection(attributes.isReverseEngineer());
              reverseEngineeringSettings.setText(safeText(attributes.getRevengSettings()));
  @@ -437,10 +451,13 @@
   	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
   		configuration.setAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR, strOrNull(outputdir.getText()));
   		configuration.setAttribute(HibernateLaunchConstants.ATTR_PREFER_BASIC_COMPOSITE_IDS, preferRawCompositeIds.isSelected());
  +		configuration.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_MANY_TO_MANY, autoManyToMany.isSelected());
  +		configuration.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_VERSIONING, autoVersioning.isSelected());
   		configuration.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, isReverseEngineerEnabled());
   		configuration.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_STRATEGY, strOrNull(reverseEngineeringStrategy.getText()));
   		configuration.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS, strOrNull(reverseEngineeringSettings.getText()));
   		
  +		
   		configuration.setAttribute(HibernateLaunchConstants.ATTR_USE_OWN_TEMPLATES, useOwnTemplates.isSelected());
   		configuration.setAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, strOrNull(templatedir.getText()));
   		
  
  
  
  1.6       +12 -0     jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ExporterAttributes.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- ExporterAttributes.java	10 Aug 2006 07:01:51 -0000	1.5
  +++ ExporterAttributes.java	14 Aug 2006 23:14:31 -0000	1.6
  @@ -65,6 +65,8 @@
      private String outputPath;
      private String templatePath;
      private List exporterFactories;
  +private boolean autoManyToManyDetection;
  +private boolean autoVersioning;
      
      public ExporterAttributes () { }
   
  @@ -89,6 +91,9 @@
            packageName = configuration.getAttribute(HibernateLaunchConstants.ATTR_PACKAGE_NAME,"");
            templatePath = configuration.getAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR,"");
            preferBasicCompositeIds = configuration.getAttribute(HibernateLaunchConstants.ATTR_PREFER_BASIC_COMPOSITE_IDS, true);
  +         autoManyToManyDetection = configuration.getAttribute( HibernateLaunchConstants.ATTR_AUTOMATIC_MANY_TO_MANY, true);
  +         autoVersioning = configuration.getAttribute( HibernateLaunchConstants.ATTR_AUTOMATIC_VERSIONING, true);
  +         
            
            if (!useOwnTemplates) {
           	 templatePath = null;
  @@ -235,6 +240,13 @@
   	   return exporterFactories;	
      }
   
  +public boolean detectManyToMany() {
  +	return autoManyToManyDetection;
  +}
  +
  +    public boolean detectOptimisticLock() {
  +    	return autoVersioning;
  +    }
      
   
      
  
  
  
  1.17      +4 -4      jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CodeGenerationLaunchDelegate.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- CodeGenerationLaunchDelegate.java	10 Aug 2006 07:01:51 -0000	1.16
  +++ CodeGenerationLaunchDelegate.java	14 Aug 2006 23:14:31 -0000	1.17
  @@ -23,7 +23,6 @@
   
   import java.io.File;
   import java.lang.reflect.Constructor;
  -import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  @@ -66,9 +65,7 @@
   import org.hibernate.console.HibernateConsoleRuntimeException;
   import org.hibernate.console.KnownConfigurations;
   import org.hibernate.console.execution.ExecutionContext.Command;
  -import org.hibernate.eclipse.console.ExtensionManager;
   import org.hibernate.eclipse.console.HibernateConsolePlugin;
  -import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
   import org.hibernate.eclipse.console.model.impl.ExporterFactory;
   import org.hibernate.tool.hbm2x.ArtifactCollector;
   import org.hibernate.tool.hbm2x.Exporter;
  @@ -218,7 +215,10 @@
   			ConsoleConfiguration cc = KnownConfigurations.getInstance().find(attributes.getConsoleConfigurationName());
   			ReverseEngineeringStrategy res = null;
   			
  -			ReverseEngineeringSettings qqsettings = new ReverseEngineeringSettings().setDefaultPackageName(attributes.getPackageName());
  +			ReverseEngineeringSettings qqsettings = new ReverseEngineeringSettings()
  +									.setDefaultPackageName(attributes.getPackageName())
  +									.setDetectManyToMany( attributes.detectManyToMany() )
  +									.setDetectOptimisticLock( attributes.detectOptimisticLock() );
   			
   			if (attributes.isReverseEngineer()) {
   				monitor.subTask("reading jdbc metadata");
  
  
  
  1.4       +2 -2      jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AddPropertyDialog.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- AddPropertyDialog.java	10 Aug 2006 07:01:51 -0000	1.3
  +++ AddPropertyDialog.java	14 Aug 2006 23:14:31 -0000	1.4
  @@ -107,12 +107,12 @@
   				List values = new ArrayList(4);
   				while ( set.hasNext() ) {
   					Map.Entry element = (Map.Entry) set.next();
  -					if(!localEf.hasLocalValueFor((String) element.getKey())) {
  +					//if(!localEf.hasLocalValueFor((String) element.getKey())) {
   						ExporterProperty exporterProperty = localEf.getExporterProperty( (String) element.getKey() );
   						if(exporterProperty!=null) {
   							values.add(exporterProperty);
   						}
  -					}			
  +					//}			
   				}
   				return values.toArray( new ExporterProperty[values.size()] );
   			}		
  
  
  
  1.5       +2 -0      jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HibernateLaunchConstants.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- HibernateLaunchConstants.java	7 Jul 2006 13:51:08 -0000	1.4
  +++ HibernateLaunchConstants.java	14 Aug 2006 23:14:31 -0000	1.5
  @@ -56,5 +56,7 @@
      public static final String ATTR_ENABLE_TEMPLATE_DIR = ATTR_PREFIX + "templatepathenabled";
      public static final String ATTR_TEMPLATE_DIR = ATTR_PREFIX + "templatepath";
      public static final String ATTR_PREFER_BASIC_COMPOSITE_IDS = ATTR_PREFIX + "prefercompositeids";
  +   public static final String ATTR_AUTOMATIC_MANY_TO_MANY = ATTR_PREFIX + "reveng.detect_many_to_many";
  +   public static final String ATTR_AUTOMATIC_VERSIONING = ATTR_PREFIX + "reveng.detect_optimistc_lock";
      
   }
  
  
  



More information about the jboss-cvs-commits mailing list