diff options
author | tle | 2008-04-16 20:43:30 +0000 |
---|---|---|
committer | tle | 2008-04-16 20:43:30 +0000 |
commit | 10f58030d6a9a9f5fe4e3ad86ed3807b48e7e062 (patch) | |
tree | 264e47fed105c869d58b5047dca81c61e44657ce /jpa | |
parent | 3a4bf55ff93c3a4754286f71f106a991ea551548 (diff) | |
download | webtools.dali-10f58030d6a9a9f5fe4e3ad86ed3807b48e7e062.tar.gz webtools.dali-10f58030d6a9a9f5fe4e3ad86ed3807b48e7e062.tar.xz webtools.dali-10f58030d6a9a9f5fe4e3ad86ed3807b48e7e062.zip |
Initial check-in.
Diffstat (limited to 'jpa')
3 files changed, 834 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/connection/BatchWriting.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/connection/BatchWriting.java new file mode 100644 index 0000000000..6a2b6ae5bd --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/connection/BatchWriting.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2008 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + *******************************************************************************/ +package org.eclipse.jpt.eclipselink.core.internal.context.connection; + +/** + * BatchWriting + */ +public enum BatchWriting { + none, + jdbc, + buffered, + oracle_jdbc; + + // EclipseLink value string + static final String NONE = "None"; + static final String JDBC = "JDBC"; + static final String BUFFERED = "Buffered"; + static final String ORACLE_JDBC = "OracleJDBC"; +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/connection/Connection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/connection/Connection.java new file mode 100644 index 0000000000..e03d86cb51 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/connection/Connection.java @@ -0,0 +1,152 @@ +/******************************************************************************* +* Copyright (c) 2008 Oracle. All rights reserved. +* This program and the accompanying materials are made available under the +* terms of the Eclipse Public License v1.0, which accompanies this distribution +* and is available at http://www.eclipse.org/legal/epl-v10.html. +* +* Contributors: +* Oracle - initial API and implementation +*******************************************************************************/ +package org.eclipse.jpt.eclipselink.core.internal.context.connection; + +import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType; +import org.eclipse.jpt.eclipselink.core.internal.context.PersistenceUnitProperties; + +/** + * Connection + */ +public interface Connection extends PersistenceUnitProperties +{ + PersistenceUnitTransactionType getDefaultTransactionType(); + PersistenceUnitTransactionType getTransactionType(); + void setTransactionType(PersistenceUnitTransactionType newTransactionType); + // PersistenceUnit property + static final String TRANSACTION_TYPE_PROPERTY = "transactionTypeProperty"; + static final PersistenceUnitTransactionType DEFAULT_TRANSACTION_TYPE = PersistenceUnitTransactionType.JTA; + + String getDefaultJtaDataSource(); + String getJtaDataSource(); + void setJtaDataSource(String newJtaDataSource); + // PersistenceUnit property + static final String JTA_DATA_SOURCE_PROPERTY = "jtaDataSourceProperty"; + static final String DEFAULT_JTA_DATA_SOURCE = ""; + + String getDefaultNonJtaDataSource(); + String getNonJtaDataSource(); + void setNonJtaDataSource(String newNonJtaDataSource); + // PersistenceUnit property + static final String NON_JTA_DATA_SOURCE_PROPERTY = "nonJtaDataSourceProperty"; + static final String DEFAULT_NON_JTA_DATA_SOURCE = ""; + + Boolean getDefaultNativeSql(); + Boolean getNativeSql(); + void setNativeSql(Boolean newNativeSql); + static final String NATIVE_SQL_PROPERTY = "nativeSqlProperty"; + // EclipseLink key string + static final String ECLIPSELINK_NATIVE_SQL = "eclipselink.jdbc.native-sql"; + static final Boolean DEFAULT_NATIVE_SQL = Boolean.FALSE; + + BatchWriting getDefaultBatchWriting(); + BatchWriting getBatchWriting(); + void setBatchWriting(BatchWriting newBatchWriting); + static final String BATCH_WRITING_PROPERTY = "batchWritingProperty"; + // EclipseLink key string + static final String ECLIPSELINK_BATCH_WRITING = "eclipselink.jdbc.batch-writing"; + static final BatchWriting DEFAULT_BATCH_WRITING = BatchWriting.none; + + Boolean getDefaultCacheStatements(); + Boolean getCacheStatements(); + void setCacheStatements(Boolean newCacheStatements); + static final String CACHE_STATEMENTS_PROPERTY = "cacheStatementsProperty"; + // EclipseLink key string + static final String ECLIPSELINK_CACHE_STATEMENTS = "eclipselink.jdbc.cache-statements"; + static final Boolean DEFAULT_CACHE_STATEMENTS = Boolean.FALSE; + + Integer getDefaultCacheStatementsSize(); + Integer getCacheStatementsSize(); + void setCacheStatementsSize(Integer newCacheStatementsSize); + static final String CACHE_STATEMENTS_SIZE_PROPERTY = "cacheStatementsSizeProperty"; + // EclipseLink key string + static final String ECLIPSELINK_CACHE_STATEMENTS_SIZE = "eclipselink.jdbc.cache-statements.size"; + static final Integer DEFAULT_CACHE_STATEMENTS_SIZE = 50; + + String getDefaultDriver(); + String getDriver(); + void setDriver(String newDriver); + static final String DRIVER_PROPERTY = "driverProperty"; + // EclipseLink key string + static final String ECLIPSELINK_DRIVER = "eclipselink.jdbc.driver"; + static final String DEFAULT_DRIVER = ""; + + String getDefaultUrl(); + String getUrl(); + void setUrl(String newUrl); + static final String URL_PROPERTY = "urlProperty"; + // EclipseLink key string + static final String ECLIPSELINK_URL = "eclipselink.jdbc.url"; + static final String DEFAULT_URL = ""; + + String getDefaultUser(); + String getUser(); + void setUser(String newUser); + static final String USER_PROPERTY = "userProperty"; + // EclipseLink key string + static final String ECLIPSELINK_USER = "eclipselink.jdbc.user"; + static final String DEFAULT_USER = ""; + + String getDefaultPassword(); + String getPassword(); + void setPassword(String newPassword); + static final String PASSWORD_PROPERTY = "passwordProperty"; + // EclipseLink key string + static final String ECLIPSELINK_PASSWORD = "eclipselink.jdbc.password"; + static final String DEFAULT_PASSWORD = ""; + + Boolean getDefaultBindParameters(); + Boolean getBindParameters(); + void setBindParameters(Boolean newBindParameters); + static final String BIND_PARAMETERS_PROPERTY = "bindParametersProperty"; + // EclipseLink key string + static final String ECLIPSELINK_BIND_PARAMETERS = "eclipselink.jdbc.bind-parameters"; + static final Boolean DEFAULT_BIND_PARAMETERS = Boolean.TRUE; + + Boolean getDefaultReadConnectionsShared(); + Boolean getReadConnectionsShared(); + void setReadConnectionsShared(Boolean newReadConnectionsShared); + static final String READ_CONNECTIONS_SHARED_PROPERTY = "readConnectionsSharedProperty"; + // EclipseLink key string + static final String ECLIPSELINK_READ_CONNECTIONS_SHARED = "eclipselink.jdbc.read-connections.shared"; + static final Boolean DEFAULT_READ_CONNECTIONS_SHARED = Boolean.FALSE; + + Integer getDefaultReadConnectionsMin(); + Integer getReadConnectionsMin(); + void setReadConnectionsMin(Integer newReadConnectionsMin); + static final String READ_CONNECTIONS_MIN_PROPERTY = "readConnectionsMinProperty"; + // EclipseLink key string + static final String ECLIPSELINK_READ_CONNECTIONS_MIN = "eclipselink.jdbc.read-connections.min"; + static final Integer DEFAULT_READ_CONNECTIONS_MIN = 2; + + Integer getDefaultReadConnectionsMax(); + Integer getReadConnectionsMax(); + void setReadConnectionsMax(Integer newReadConnectionsMax); + static final String READ_CONNECTIONS_MAX_PROPERTY = "readConnectionsMaxProperty"; + // EclipseLink key string + static final String ECLIPSELINK_READ_CONNECTIONS_MAX = "eclipselink.jdbc.read-connections.max"; + static final Integer DEFAULT_READ_CONNECTIONS_MAX = 2; + + Integer getDefaultWriteConnectionsMin(); + Integer getWriteConnectionsMin(); + void setWriteConnectionsMin(Integer newWriteConnectionsMin); + static final String WRITE_CONNECTIONS_MIN_PROPERTY = "writeConnectionsMinProperty"; + // EclipseLink key string + static final String ECLIPSELINK_WRITE_CONNECTIONS_MIN = "eclipselink.jdbc.write-connections.min"; + static final Integer DEFAULT_WRITE_CONNECTIONS_MIN = 5; + + Integer getDefaultWriteConnectionsMax(); + Integer getWriteConnectionsMax(); + void setWriteConnectionsMax(Integer newWriteConnectionsMax); + static final String WRITE_CONNECTIONS_MAX_PROPERTY = "writeConnectionsMaxProperty"; + // EclipseLink key string + static final String ECLIPSELINK_WRITE_CONNECTIONS_MAX = "eclipselink.jdbc.write-connections.max"; + static final Integer DEFAULT_WRITE_CONNECTIONS_MAX = 10; +} diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/connection/EclipseLinkConnection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/connection/EclipseLinkConnection.java new file mode 100644 index 0000000000..0e56f5001f --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/connection/EclipseLinkConnection.java @@ -0,0 +1,656 @@ +/******************************************************************************* +* Copyright (c) 2008 Oracle. All rights reserved. +* This program and the accompanying materials are made available under the +* terms of the Eclipse Public License v1.0, which accompanies this distribution +* and is available at http://www.eclipse.org/legal/epl-v10.html. +* +* Contributors: +* Oracle - initial API and implementation +*******************************************************************************/ +package org.eclipse.jpt.eclipselink.core.internal.context.connection; + +import java.util.Map; + +import org.eclipse.jpt.core.context.persistence.PersistenceUnit; +import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType; +import org.eclipse.jpt.core.context.persistence.Property; +import org.eclipse.jpt.eclipselink.core.internal.context.EclipseLinkPersistenceUnitProperties; +import org.eclipse.jpt.utility.model.event.PropertyChangeEvent; +import org.eclipse.jpt.utility.model.listener.PropertyChangeListener; +import org.eclipse.jpt.utility.model.value.ListValueModel; + +/** + * EclipseLinkConnection + */ +public class EclipseLinkConnection extends EclipseLinkPersistenceUnitProperties + implements Connection +{ + // ********** PersistenceUnit properties ********** + private PersistenceUnitTransactionType transactionType; + private String jtaDataSource; + private String nonJtaDataSource; + + // ********** EclipseLink properties ********** + private BatchWriting batchWriting; + private Boolean nativeSql; + private Boolean cacheStatements; + private Integer cacheStatementsSize; + private String driver; + private String url; + private String user; + private String password; + private Boolean bindParameters; + private Boolean readConnectionsShared; + private Integer readConnectionsMin; + private Integer readConnectionsMax; + private Integer writeConnectionsMin; + private Integer writeConnectionsMax; + + + // ********** constructors ********** + public EclipseLinkConnection(PersistenceUnit parent, ListValueModel<Property> propertyListAdapter) { + super(parent, propertyListAdapter); + } + + // ********** initialization ********** + /** + * Initializes properties with values from the persistence unit. + */ + @Override + protected void initializeProperties() { + // TOREVIEW - handle incorrect String in persistence.xml + this.transactionType = + this.persistenceUnit().getSpecifiedTransactionType(); + this.jtaDataSource = + this.persistenceUnit().getJtaDataSource(); + this.nonJtaDataSource = + this.persistenceUnit().getNonJtaDataSource(); + this.batchWriting = + this.getEnumValue(ECLIPSELINK_BATCH_WRITING, BatchWriting.values()); + this.nativeSql = + this.getBooleanValue(ECLIPSELINK_NATIVE_SQL); + this.cacheStatements = + this.getBooleanValue(ECLIPSELINK_CACHE_STATEMENTS); + this.cacheStatementsSize = + this.getIntegerValue(ECLIPSELINK_CACHE_STATEMENTS_SIZE); + this.driver = + this.getStringValue(ECLIPSELINK_DRIVER); + this.url = + this.getStringValue(ECLIPSELINK_URL); + this.user = + this.getStringValue(ECLIPSELINK_USER); + this.password = + this.getStringValue(ECLIPSELINK_PASSWORD); + this.bindParameters = + this.getBooleanValue(ECLIPSELINK_BIND_PARAMETERS); + this.readConnectionsShared = + this.getBooleanValue(ECLIPSELINK_READ_CONNECTIONS_SHARED); + this.readConnectionsMin = + this.getIntegerValue(ECLIPSELINK_READ_CONNECTIONS_MIN); + this.readConnectionsMax = + this.getIntegerValue(ECLIPSELINK_READ_CONNECTIONS_MAX); + this.writeConnectionsMin = + this.getIntegerValue(ECLIPSELINK_WRITE_CONNECTIONS_MIN); + this.writeConnectionsMax = + this.getIntegerValue(ECLIPSELINK_WRITE_CONNECTIONS_MAX); + + } + + /** + * Initialize and add listeners to the persistence unit. + */ + @Override + protected void initialize(PersistenceUnit parent, ListValueModel<Property> propertyListAdapter) { + super.initialize(parent, propertyListAdapter); + + this.persistenceUnit().addPropertyChangeListener( + PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY, + this.buildTransactionTypeChangeListener()); + this.persistenceUnit().addPropertyChangeListener( + PersistenceUnit.JTA_DATA_SOURCE_PROPERTY, + this.buildJtaDataSourceChangeListener()); + this.persistenceUnit().addPropertyChangeListener( + PersistenceUnit.NON_JTA_DATA_SOURCE_PROPERTY, + this.buildNonJtaDataSourceChangeListener()); + } + + // ********** behavior ********** + /** + * Adds property names key/value pairs, where: + * key = EclipseLink property key + * value = property id + */ + @Override + protected void addPropertyNames(Map<String, String> propertyNames) { + propertyNames.put( + ECLIPSELINK_NATIVE_SQL, + NATIVE_SQL_PROPERTY); + propertyNames.put( + ECLIPSELINK_BATCH_WRITING, + BATCH_WRITING_PROPERTY); + propertyNames.put( + ECLIPSELINK_CACHE_STATEMENTS, + CACHE_STATEMENTS_PROPERTY); + propertyNames.put( + ECLIPSELINK_CACHE_STATEMENTS_SIZE, + CACHE_STATEMENTS_SIZE_PROPERTY); + propertyNames.put( + ECLIPSELINK_DRIVER, + DRIVER_PROPERTY); + propertyNames.put( + ECLIPSELINK_URL, + URL_PROPERTY); + propertyNames.put( + ECLIPSELINK_USER, + USER_PROPERTY); + propertyNames.put( + ECLIPSELINK_PASSWORD, + PASSWORD_PROPERTY); + propertyNames.put( + ECLIPSELINK_BIND_PARAMETERS, + BIND_PARAMETERS_PROPERTY); + propertyNames.put( + ECLIPSELINK_READ_CONNECTIONS_SHARED, + READ_CONNECTIONS_SHARED_PROPERTY); + propertyNames.put( + ECLIPSELINK_READ_CONNECTIONS_MIN, + READ_CONNECTIONS_MIN_PROPERTY); + propertyNames.put( + ECLIPSELINK_READ_CONNECTIONS_MAX, + READ_CONNECTIONS_MAX_PROPERTY); + propertyNames.put( + ECLIPSELINK_WRITE_CONNECTIONS_MIN, + WRITE_CONNECTIONS_MIN_PROPERTY); + propertyNames.put( + ECLIPSELINK_WRITE_CONNECTIONS_MAX, + WRITE_CONNECTIONS_MAX_PROPERTY); + } + + public void propertyChanged(PropertyChangeEvent event) { + String aspectName = event.getAspectName(); + if (aspectName.equals(NATIVE_SQL_PROPERTY)) { + this.nativeSqlChanged(event); + } + else if (aspectName.equals(BATCH_WRITING_PROPERTY)) { + this.batchWritingChanged(event); + } + else if (aspectName.equals(CACHE_STATEMENTS_PROPERTY)) { + this.cacheStatementsChanged(event); + } + else if (aspectName.equals(DRIVER_PROPERTY)) { + this.driverChanged(event); + } + else if (aspectName.equals(URL_PROPERTY)) { + this.urlChanged(event); + } + else if (aspectName.equals(USER_PROPERTY)) { + this.userChanged(event); + } + else if (aspectName.equals(PASSWORD_PROPERTY)) { + this.passwordChanged(event); + } + else if (aspectName.equals(BIND_PARAMETERS_PROPERTY)) { + this.bindParametersChanged(event); + } + else if (aspectName.equals(READ_CONNECTIONS_SHARED_PROPERTY)) { + this.readConnectionsSharedChanged(event); + } + else if (aspectName.equals(CACHE_STATEMENTS_SIZE_PROPERTY)) { + this.cacheStatementsSizeChanged(event); + } + else if (aspectName.equals(READ_CONNECTIONS_MIN_PROPERTY)) { + this.readConnectionsMinChanged(event); + } + else if (aspectName.equals(READ_CONNECTIONS_MAX_PROPERTY)) { + this.readConnectionsMaxChanged(event); + } + else if (aspectName.equals(WRITE_CONNECTIONS_MIN_PROPERTY)) { + this.writeConnectionsMinChanged(event); + } + else if (aspectName.equals(WRITE_CONNECTIONS_MAX_PROPERTY)) { + this.writeConnectionsMaxChanged(event); + } + } + + // ********** TransactionType ********** + + public PersistenceUnitTransactionType getTransactionType() { + return this.transactionType; + } + + public void setTransactionType(PersistenceUnitTransactionType newTransactionType) { + PersistenceUnitTransactionType old = this.transactionType; + this.transactionType = newTransactionType; + + this.persistenceUnit().setSpecifiedTransactionType( newTransactionType); + this.firePropertyChanged(TRANSACTION_TYPE_PROPERTY, old, newTransactionType); + } + + private void transactionTypeChanged(PropertyChangeEvent event) { + PersistenceUnitTransactionType newValue = (PersistenceUnitTransactionType) event.getNewValue(); + PersistenceUnitTransactionType old = this.transactionType; + this.transactionType = newValue; + this.firePropertyChanged(TRANSACTION_TYPE_PROPERTY, old, newValue); + } + + public PersistenceUnitTransactionType getDefaultTransactionType() { + return DEFAULT_TRANSACTION_TYPE; + } + + protected PropertyChangeListener buildTransactionTypeChangeListener() { + return new PropertyChangeListener() { + public void propertyChanged(PropertyChangeEvent event) { + EclipseLinkConnection.this.transactionTypeChanged(event); + } + }; + } + + // ********** JtaDataSource ********** + + public String getJtaDataSource() { + return this.jtaDataSource; + } + + public void setJtaDataSource(String newJtaDataSource) { + String old = this.jtaDataSource; + this.jtaDataSource = newJtaDataSource; + + this.persistenceUnit().setJtaDataSource( newJtaDataSource); + this.firePropertyChanged(JTA_DATA_SOURCE_PROPERTY, old, newJtaDataSource); + } + + private void jtaDataSourceChanged(PropertyChangeEvent event) { + String newValue = (String) event.getNewValue(); + String old = this.jtaDataSource; + this.jtaDataSource = newValue; + this.firePropertyChanged(JTA_DATA_SOURCE_PROPERTY, old, newValue); + } + + public String getDefaultJtaDataSource() { + return DEFAULT_JTA_DATA_SOURCE; + } + + protected PropertyChangeListener buildJtaDataSourceChangeListener() { + return new PropertyChangeListener() { + public void propertyChanged(PropertyChangeEvent event) { + EclipseLinkConnection.this.jtaDataSourceChanged(event); + } + }; + } + + // ********** NonJtaDataSource ********** + + public String getNonJtaDataSource() { + return this.nonJtaDataSource; + } + + public void setNonJtaDataSource(String newNonJtaDataSource) { + String old = this.nonJtaDataSource; + this.nonJtaDataSource = newNonJtaDataSource; + + this.persistenceUnit().setNonJtaDataSource( newNonJtaDataSource); + this.firePropertyChanged(NON_JTA_DATA_SOURCE_PROPERTY, old, newNonJtaDataSource); + } + + private void nonJtaDataSourceChanged(PropertyChangeEvent event) { + String newValue = (String) event.getNewValue(); + String old = this.nonJtaDataSource; + this.nonJtaDataSource = newValue; + this.firePropertyChanged(NON_JTA_DATA_SOURCE_PROPERTY, old, newValue); + } + + public String getDefaultNonJtaDataSource() { + return DEFAULT_NON_JTA_DATA_SOURCE; + } + + protected PropertyChangeListener buildNonJtaDataSourceChangeListener() { + return new PropertyChangeListener() { + public void propertyChanged(PropertyChangeEvent event) { + EclipseLinkConnection.this.nonJtaDataSourceChanged(event); + } + }; + } + + // ********** NativeSql ********** + public Boolean getNativeSql() { + return this.nativeSql; + } + + public void setNativeSql(Boolean newNativeSql) { + Boolean old = this.nativeSql; + this.nativeSql = newNativeSql; + this.putProperty(NATIVE_SQL_PROPERTY, newNativeSql); + this.firePropertyChanged(NATIVE_SQL_PROPERTY, old, newNativeSql); + } + + private void nativeSqlChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + Boolean newValue = getBooleanValueOf(stringValue); + + Boolean old = this.nativeSql; + this.nativeSql = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public Boolean getDefaultNativeSql() { + return DEFAULT_NATIVE_SQL; + } + + // ********** BatchWriting ********** + + public BatchWriting getBatchWriting() { + return this.batchWriting; + } + + public void setBatchWriting(BatchWriting newBatchWriting) { + BatchWriting old = this.batchWriting; + this.batchWriting = newBatchWriting; + this.putProperty(BATCH_WRITING_PROPERTY, newBatchWriting); + this.firePropertyChanged(BATCH_WRITING_PROPERTY, old, newBatchWriting); + } + + private void batchWritingChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + BatchWriting newValue = getEnumValueOf(stringValue, BatchWriting.values()); + BatchWriting old = this.batchWriting; + this.batchWriting = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public BatchWriting getDefaultBatchWriting() { + return DEFAULT_BATCH_WRITING; + } + + // ********** CacheStatements ********** + public Boolean getCacheStatements() { + return this.cacheStatements; + } + + public void setCacheStatements(Boolean newCacheStatements) { + Boolean old = this.cacheStatements; + this.cacheStatements = newCacheStatements; + this.putProperty(CACHE_STATEMENTS_PROPERTY, newCacheStatements); + this.firePropertyChanged(CACHE_STATEMENTS_PROPERTY, old, newCacheStatements); + } + + private void cacheStatementsChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + Boolean newValue = getBooleanValueOf(stringValue); + + Boolean old = this.cacheStatements; + this.cacheStatements = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public Boolean getDefaultCacheStatements() { + return DEFAULT_CACHE_STATEMENTS; + } + + // ********** CacheStatementsSize ********** + public Integer getCacheStatementsSize() { + return this.cacheStatementsSize; + } + + public void setCacheStatementsSize(Integer newCacheStatementsSize) { + Integer old = this.cacheStatementsSize; + this.cacheStatementsSize = newCacheStatementsSize; + this.putProperty(CACHE_STATEMENTS_SIZE_PROPERTY, newCacheStatementsSize); + this.firePropertyChanged(CACHE_STATEMENTS_SIZE_PROPERTY, old, newCacheStatementsSize); + } + + private void cacheStatementsSizeChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + Integer newValue = getIntegerValueOf(stringValue); + + Integer old = this.cacheStatementsSize; + this.cacheStatementsSize = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public Integer getDefaultCacheStatementsSize() { + return DEFAULT_CACHE_STATEMENTS_SIZE; + } + + // ********** Driver ********** + public String getDriver() { + return this.driver; + } + + public void setDriver(String newDriver) { + String old = this.driver; + this.driver = newDriver; + this.putProperty(DRIVER_PROPERTY, newDriver); + this.firePropertyChanged(DRIVER_PROPERTY, old, newDriver); + } + + private void driverChanged(PropertyChangeEvent event) { + String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + String old = this.driver; + this.driver = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public String getDefaultDriver() { + return DEFAULT_DRIVER; + } + + // ********** URL ********** + public String getUrl() { + return this.url; + } + + public void setUrl(String newUrl) { + String old = this.url; + this.url = newUrl; + this.putProperty(URL_PROPERTY, newUrl); + this.firePropertyChanged(URL_PROPERTY, old, newUrl); + } + + private void urlChanged(PropertyChangeEvent event) { + String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + String old = this.url; + this.url = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public String getDefaultUrl() { + return DEFAULT_URL; + } + + // ********** User ********** + public String getUser() { + return this.user; + } + + public void setUser(String newUser) { + String old = this.user; + this.user = newUser; + this.putProperty(USER_PROPERTY, newUser); + this.firePropertyChanged(USER_PROPERTY, old, newUser); + } + + private void userChanged(PropertyChangeEvent event) { + String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + String old = this.user; + this.user = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public String getDefaultUser() { + return DEFAULT_USER; + } + + // ********** Password ********** + public String getPassword() { + return this.password; + } + + public void setPassword(String newPassword) { + String old = this.password; + this.password = newPassword; + this.putProperty(PASSWORD_PROPERTY, newPassword); + this.firePropertyChanged(PASSWORD_PROPERTY, old, newPassword); + } + + private void passwordChanged(PropertyChangeEvent event) { + String newValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + String old = this.password; + this.password = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public String getDefaultPassword() { + return DEFAULT_PASSWORD; + } + + // ********** BindParameters ********** + public Boolean getBindParameters() { + return this.bindParameters; + } + + public void setBindParameters(Boolean newBindParameters) { + Boolean old = this.bindParameters; + this.bindParameters = newBindParameters; + this.putProperty(BIND_PARAMETERS_PROPERTY, newBindParameters); + this.firePropertyChanged(BIND_PARAMETERS_PROPERTY, old, newBindParameters); + } + + private void bindParametersChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + Boolean newValue = getBooleanValueOf(stringValue); + + Boolean old = this.bindParameters; + this.bindParameters = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public Boolean getDefaultBindParameters() { + return DEFAULT_BIND_PARAMETERS; + } + + // ********** ReadConnectionsShared ********** + public Boolean getReadConnectionsShared() { + return this.readConnectionsShared; + } + + public void setReadConnectionsShared(Boolean newReadConnectionsShared) { + Boolean old = this.readConnectionsShared; + this.readConnectionsShared = newReadConnectionsShared; + this.putProperty(READ_CONNECTIONS_SHARED_PROPERTY, newReadConnectionsShared); + this.firePropertyChanged(READ_CONNECTIONS_SHARED_PROPERTY, old, newReadConnectionsShared); + } + + private void readConnectionsSharedChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + Boolean newValue = getBooleanValueOf(stringValue); + + Boolean old = this.readConnectionsShared; + this.readConnectionsShared = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public Boolean getDefaultReadConnectionsShared() { + return DEFAULT_READ_CONNECTIONS_SHARED; + } + + // ********** ReadConnectionsMin ********** + public Integer getReadConnectionsMin() { + return this.readConnectionsMin; + } + + public void setReadConnectionsMin(Integer newReadConnectionsMin) { + Integer old = this.readConnectionsMin; + this.readConnectionsMin = newReadConnectionsMin; + this.putProperty(READ_CONNECTIONS_MIN_PROPERTY, newReadConnectionsMin); + this.firePropertyChanged(READ_CONNECTIONS_MIN_PROPERTY, old, newReadConnectionsMin); + } + + private void readConnectionsMinChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + Integer newValue = getIntegerValueOf(stringValue); + + Integer old = this.readConnectionsMin; + this.readConnectionsMin = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public Integer getDefaultReadConnectionsMin() { + return DEFAULT_READ_CONNECTIONS_MIN; + } + + // ********** ReadConnectionsMax ********** + public Integer getReadConnectionsMax() { + return this.readConnectionsMax; + } + + public void setReadConnectionsMax(Integer newReadConnectionsMax) { + Integer old = this.readConnectionsMax; + this.readConnectionsMax = newReadConnectionsMax; + this.putProperty(READ_CONNECTIONS_MAX_PROPERTY, newReadConnectionsMax); + this.firePropertyChanged(READ_CONNECTIONS_MAX_PROPERTY, old, newReadConnectionsMax); + } + + private void readConnectionsMaxChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + Integer newValue = getIntegerValueOf(stringValue); + + Integer old = this.readConnectionsMax; + this.readConnectionsMax = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public Integer getDefaultReadConnectionsMax() { + return DEFAULT_READ_CONNECTIONS_MAX; + } + + // ********** WriteConnectionsMin ********** + public Integer getWriteConnectionsMin() { + return this.writeConnectionsMin; + } + + public void setWriteConnectionsMin(Integer newWriteConnectionsMin) { + Integer old = this.writeConnectionsMin; + this.writeConnectionsMin = newWriteConnectionsMin; + this.putProperty(WRITE_CONNECTIONS_MIN_PROPERTY, newWriteConnectionsMin); + this.firePropertyChanged(WRITE_CONNECTIONS_MIN_PROPERTY, old, newWriteConnectionsMin); + } + + private void writeConnectionsMinChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + Integer newValue = getIntegerValueOf(stringValue); + + Integer old = this.writeConnectionsMin; + this.writeConnectionsMin = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public Integer getDefaultWriteConnectionsMin() { + return DEFAULT_WRITE_CONNECTIONS_MIN; + } + + // ********** WriteConnectionsMax ********** + public Integer getWriteConnectionsMax() { + return this.writeConnectionsMax; + } + + public void setWriteConnectionsMax(Integer newWriteConnectionsMax) { + Integer old = this.writeConnectionsMax; + this.writeConnectionsMax = newWriteConnectionsMax; + this.putProperty(WRITE_CONNECTIONS_MAX_PROPERTY, newWriteConnectionsMax); + this.firePropertyChanged(WRITE_CONNECTIONS_MAX_PROPERTY, old, newWriteConnectionsMax); + } + + private void writeConnectionsMaxChanged(PropertyChangeEvent event) { + String stringValue = (event.getNewValue() == null) ? null : ((Property) event.getNewValue()).getValue(); + Integer newValue = getIntegerValueOf(stringValue); + + Integer old = this.writeConnectionsMax; + this.writeConnectionsMax = newValue; + this.firePropertyChanged(event.getAspectName(), old, newValue); + } + + public Integer getDefaultWriteConnectionsMax() { + return DEFAULT_WRITE_CONNECTIONS_MAX; + } + +} |