You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2017/09/16 09:15:22 UTC
svn commit: r1808526 - in
/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql:
./ sdbcx/ sdbcx/descriptors/
Author: damjan
Date: Sat Sep 16 09:15:21 2017
New Revision: 1808526
URL: http://svn.apache.org/viewvc?rev=1808526&view=rev
Log:
Now that locking has been simplified, we can also delete the special
factory create() methods on objects, and use constructors instead
to simplify creation further.
Patch by: me
Modified:
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java Sat Sep 16 09:15:21 2017
@@ -42,7 +42,7 @@ import com.sun.star.sdbcx.comp.postgresq
import com.sun.star.sdbcx.comp.postgresql.sdbcx.descriptors.SdbcxTableDescriptor;
public class PostgresqlTable extends OTable {
- private PostgresqlTable(XConnection connection, OContainer tables, String name,
+ public PostgresqlTable(XConnection connection, OContainer tables, String name,
String catalogName, String schemaName, String description, String type) {
super(name, true, connection, tables);
super.catalogName = catalogName;
@@ -51,14 +51,9 @@ public class PostgresqlTable extends OTa
super.type = type;
}
- public static PostgresqlTable create(XConnection connection, OContainer tables, String name,
- String catalogName, String schemaName, String description, String type) {
- return new PostgresqlTable(connection, tables, name, catalogName, schemaName, description, type);
- }
-
@Override
public XPropertySet createDataDescriptor() {
- SdbcxTableDescriptor descriptor = SdbcxTableDescriptor.create(true);
+ SdbcxTableDescriptor descriptor = new SdbcxTableDescriptor(true);
synchronized (this) {
CompHelper.copyProperties(this, descriptor);
}
@@ -118,7 +113,7 @@ public class PostgresqlTable extends OTa
try {
Map<String, OKey> keys = new SqlTableHelper().readKeys(
getConnection().getMetaData(), catalogName, schemaName, getName(), isCaseSensitive(), this);
- return OKeyContainer.create(isCaseSensitive(), keys, this);
+ return new OKeyContainer(this, isCaseSensitive(), keys, this);
} catch (ElementExistException elementExistException) {
return null;
} catch (SQLException sqlException) {
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java Sat Sep 16 09:15:21 2017
@@ -69,7 +69,7 @@ public class PostgresqlTables extends OC
if (results.next()) {
String type = row.getString(4);
String remarks = row.getString(5);
- ret = PostgresqlTable.create(metadata.getConnection(), this, nameComponents.getTable(),
+ ret = new PostgresqlTable(metadata.getConnection(), this, nameComponents.getTable(),
nameComponents.getCatalog(), nameComponents.getSchema(), remarks, type);
}
}
@@ -117,7 +117,7 @@ public class PostgresqlTables extends OC
@Override
public XPropertySet createDescriptor() {
- return SdbcxTableDescriptor.create(true);
+ return new SdbcxTableDescriptor(true);
}
@Override
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java Sat Sep 16 09:15:21 2017
@@ -45,7 +45,7 @@ public class OColumn extends ODescriptor
private boolean isRowVersion;
private boolean isCurrency;
- protected OColumn(final boolean isCaseSensitive) {
+ public OColumn(final boolean isCaseSensitive) {
super("", isCaseSensitive);
this.isNullable = ColumnValue.NULLABLE;
this.precision = 0;
@@ -57,11 +57,7 @@ public class OColumn extends ODescriptor
registerProperties();
}
- public static OColumn create(final boolean isCaseSensitive) {
- return new OColumn(isCaseSensitive);
- }
-
- protected OColumn(
+ public OColumn(
final String name,
final String typeName,
final String defaultValue,
@@ -88,24 +84,6 @@ public class OColumn extends ODescriptor
registerProperties();
}
- public static OColumn create(
- final String name,
- final String typeName,
- final String defaultValue,
- final String description,
- final int isNullable,
- final int precision,
- final int scale,
- final int type,
- final boolean isAutoIncrement,
- final boolean isRowVersion,
- final boolean isCurrency,
- final boolean isCaseSensitive) {
- return new OColumn(name, typeName, defaultValue, description,
- isNullable, precision, scale, type, isAutoIncrement, isRowVersion,
- isCurrency, isCaseSensitive);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.TYPENAME.name, PropertyIds.TYPENAME.id, Type.STRING, PropertyAttribute.READONLY,
new PropertyGetter() {
@@ -260,7 +238,7 @@ public class OColumn extends ODescriptor
@Override
public XPropertySet createDataDescriptor() {
- SdbcxColumnDescriptor descriptor = SdbcxColumnDescriptor.create(isCaseSensitive());
+ SdbcxColumnDescriptor descriptor = new SdbcxColumnDescriptor(isCaseSensitive());
synchronized (this) {
CompHelper.copyProperties(this, descriptor);
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java Sat Sep 16 09:15:21 2017
@@ -94,7 +94,7 @@ public class OColumnContainer extends OC
if (nullable != ColumnValue.NO_NULLS && primaryKeyColumns != null && primaryKeyColumns.hasByName(name)) {
nullable = ColumnValue.NO_NULLS;
}
- return OColumn.create(name, columnDescription.typeName, columnDescription.defaultValue, columnDescription.remarks,
+ return new OColumn(name, columnDescription.typeName, columnDescription.defaultValue, columnDescription.remarks,
nullable, columnDescription.columnSize, columnDescription.decimalDigits, columnDescription.type,
isAutoIncrement, false, isCurrency, isCaseSensitive());
} else {
@@ -105,7 +105,7 @@ public class OColumnContainer extends OC
@Override
protected XPropertySet createDescriptor() {
- return SdbcxColumnDescriptor.create(isCaseSensitive());
+ return new SdbcxColumnDescriptor(isCaseSensitive());
}
@Override
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java Sat Sep 16 09:15:21 2017
@@ -45,7 +45,7 @@ public class OIndex extends ODescriptor
private OTable table;
private OContainer columns;
- protected OIndex(String name, boolean isCaseSensitive, String catalogName,
+ public OIndex(String name, boolean isCaseSensitive, String catalogName,
boolean isUnique, boolean isPrimaryKeyIndex, boolean isClustered, List<String> columnNames, OTable table) throws ElementExistException {
super(name, isCaseSensitive);
this.catalogName = catalogName;
@@ -57,11 +57,6 @@ public class OIndex extends ODescriptor
registerProperties();
}
- public static OIndex create(String name, boolean isCaseSensitive, String catalogName,
- boolean isUnique, boolean isPrimaryKeyIndex, boolean isClustered, List<String> columnNames, OTable table) throws ElementExistException {
- return new OIndex(name, isCaseSensitive, catalogName, isUnique, isPrimaryKeyIndex, isClustered, columnNames, table);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.CATALOG.name, PropertyIds.CATALOG.id, Type.STRING, (short)PropertyAttribute.READONLY,
new PropertyGetter() {
@@ -95,7 +90,7 @@ public class OIndex extends ODescriptor
@Override
public XPropertySet createDataDescriptor() {
- SdbcxIndexDescriptor descriptor = SdbcxIndexDescriptor.create(isCaseSensitive());
+ SdbcxIndexDescriptor descriptor = new SdbcxIndexDescriptor(isCaseSensitive());
CompHelper.copyProperties(this, descriptor);
try {
DbTools.cloneDescriptorColumns(this, descriptor);
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java Sat Sep 16 09:15:21 2017
@@ -32,7 +32,7 @@ import com.sun.star.uno.Type;
public class OIndexColumn extends OColumn {
protected boolean isAscending;
- protected OIndexColumn(
+ public OIndexColumn(
final boolean isAscending,
final String name,
final String typeName,
@@ -52,24 +52,6 @@ public class OIndexColumn extends OColum
registerProperties();
}
- public static OIndexColumn create(
- final boolean isAscending,
- final String name,
- final String typeName,
- final String defaultValue,
- final int isNullable,
- final int precision,
- final int scale,
- final int type,
- final boolean isAutoIncrement,
- final boolean isRowVersion,
- final boolean isCurrency,
- final boolean isCaseSensitive) {
- return new OIndexColumn(isAscending, name, typeName,
- defaultValue, "", isNullable, precision, scale,
- type, isAutoIncrement, isRowVersion, isCurrency, isCaseSensitive);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.ISASCENDING.name, PropertyIds.ISASCENDING.id, Type.BOOLEAN, PropertyAttribute.READONLY,
new PropertyGetter() {
@@ -85,7 +67,7 @@ public class OIndexColumn extends OColum
@Override
public XPropertySet createDataDescriptor() {
- SdbcxIndexColumnDescriptor descriptor = SdbcxIndexColumnDescriptor.create(isCaseSensitive());
+ SdbcxIndexColumnDescriptor descriptor = new SdbcxIndexColumnDescriptor(isCaseSensitive());
synchronized (this) {
CompHelper.copyProperties(this, descriptor);
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java Sat Sep 16 09:15:21 2017
@@ -48,7 +48,7 @@ public class OIndexColumnContainer exten
@Override
protected XPropertySet createDescriptor() {
- return SdbcxIndexColumnDescriptor.create(isCaseSensitive());
+ return new SdbcxIndexColumnDescriptor(isCaseSensitive());
}
@Override
@@ -89,7 +89,7 @@ public class OIndexColumnContainer exten
int nul = row.getInt(11);
String columnDef = row.getString(13);
- ret = OIndexColumn.create(isAscending, name, typeName, columnDef,
+ ret = new OIndexColumn(isAscending, name, typeName, columnDef, "",
nul, size, dec, dataType, false, false, false, isCaseSensitive());
break;
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java Sat Sep 16 09:15:21 2017
@@ -58,7 +58,7 @@ public class OIndexContainer extends OCo
@Override
protected XPropertySet createDescriptor() {
- return SdbcxIndexDescriptor.create(isCaseSensitive());
+ return new SdbcxIndexDescriptor(isCaseSensitive());
}
@Override
@@ -106,7 +106,7 @@ public class OIndexContainer extends OCo
}
}
if (found) {
- ret = OIndex.create(subname, isCaseSensitive(), qualifier, isUnique, isPrimaryKeyIndex, clustered == IndexType.CLUSTERED,
+ ret = new OIndex(subname, isCaseSensitive(), qualifier, isUnique, isPrimaryKeyIndex, clustered == IndexType.CLUSTERED,
columnNames, table);
}
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java Sat Sep 16 09:15:21 2017
@@ -53,7 +53,7 @@ public class OKey extends ODescriptor
registerProperties();
}
- protected OKey(String name, boolean isCaseSensitive, String referencedTable, int type,
+ public OKey(String name, boolean isCaseSensitive, String referencedTable, int type,
int updateRule, int deleteRule, List<String> columnNames, OTable table) throws ElementExistException {
super(name, isCaseSensitive);
this.referencedTable = referencedTable;
@@ -65,11 +65,6 @@ public class OKey extends ODescriptor
columns = new OKeyColumnContainer(this, this, columnNames);
}
- public static OKey create(String name, boolean isCaseSensitive, String referencedTable, int type,
- int updateRule, int deleteRule, List<String> columnNames, OTable table) throws ElementExistException {
- return new OKey(name, isCaseSensitive, referencedTable, type, updateRule, deleteRule, columnNames, table);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.REFERENCEDTABLE.name, PropertyIds.REFERENCEDTABLE.id, Type.STRING, (short)PropertyAttribute.READONLY,
new PropertyGetter() {
@@ -116,7 +111,7 @@ public class OKey extends ODescriptor
// XDataDescriptionFactory
public XPropertySet createDataDescriptor() {
- SdbcxKeyDescriptor descriptor = SdbcxKeyDescriptor.create(isCaseSensitive());
+ SdbcxKeyDescriptor descriptor = new SdbcxKeyDescriptor(isCaseSensitive());
CompHelper.copyProperties(this, descriptor);
try {
DbTools.cloneDescriptorColumns(this, descriptor);
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java Sat Sep 16 09:15:21 2017
@@ -37,7 +37,7 @@ public class OKeyColumn extends OColumn
registerProperties();
}
- protected OKeyColumn(
+ public OKeyColumn(
final String referencedColumn,
final String name,
final String typeName,
@@ -57,24 +57,6 @@ public class OKeyColumn extends OColumn
registerProperties();
}
- public static OKeyColumn create(
- final String referencedColumn,
- final String name,
- final String typeName,
- final String defaultValue,
- final int isNullable,
- final int precision,
- final int scale,
- final int type,
- final boolean isAutoIncrement,
- final boolean isRowVersion,
- final boolean isCurrency,
- final boolean isCaseSensitive) {
- return new OKeyColumn(referencedColumn, name, typeName,
- defaultValue, "", isNullable, precision, scale,
- type, isAutoIncrement, isRowVersion, isCurrency, isCaseSensitive);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.RELATEDCOLUMN.name, PropertyIds.RELATEDCOLUMN.id, Type.STRING, PropertyAttribute.READONLY,
new PropertyGetter() {
@@ -90,7 +72,7 @@ public class OKeyColumn extends OColumn
@Override
public XPropertySet createDataDescriptor() {
- SdbcxKeyColumnDescriptor descriptor = SdbcxKeyColumnDescriptor.create(isCaseSensitive());
+ SdbcxKeyColumnDescriptor descriptor = new SdbcxKeyColumnDescriptor(isCaseSensitive());
synchronized (this) {
CompHelper.copyProperties(this, descriptor);
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java Sat Sep 16 09:15:21 2017
@@ -47,7 +47,7 @@ public class OKeyColumnContainer extends
@Override
protected XPropertySet createDescriptor() {
- return SdbcxKeyColumnDescriptor.create(isCaseSensitive());
+ return new SdbcxKeyColumnDescriptor(isCaseSensitive());
}
@Override
@@ -88,8 +88,8 @@ public class OKeyColumnContainer extends
} catch (SQLException sqlException) {
// sometimes we get an error when asking for this param
}
- ret = OKeyColumn.create(refColumnName, name, typeName,
- columnDef, nul, size, dec, dataType, false, false, false, isCaseSensitive());
+ ret = new OKeyColumn(refColumnName, name, typeName,
+ "", columnDef, nul, size, dec, dataType, false, false, false, isCaseSensitive());
}
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java Sat Sep 16 09:15:21 2017
@@ -23,7 +23,6 @@ package com.sun.star.sdbcx.comp.postgres
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.List;
import java.util.Map;
import com.sun.star.beans.PropertyVetoException;
@@ -55,8 +54,8 @@ public class OKeyContainer extends OCont
private OTable table;
private Map<String,OKey> keys;
- protected OKeyContainer(Object lock, boolean isCaseSensitive, List<String> names, Map<String,OKey> keys, OTable table) throws ElementExistException {
- super(lock, isCaseSensitive, names);
+ public OKeyContainer(Object lock, boolean isCaseSensitive, Map<String,OKey> keys, OTable table) throws ElementExistException {
+ super(lock, isCaseSensitive, Arrays.asList(keys.keySet().toArray(new String[keys.size()])));
System.out.println("Keys.size()=" + keys.size());
for (Map.Entry<String,OKey> entry : keys.entrySet()) {
System.out.println(entry.getKey() + " => " + entry.getValue().referencedTable);
@@ -78,16 +77,9 @@ public class OKeyContainer extends OCont
this.table = table;
}
- public static OKeyContainer create(boolean isCaseSensitive, Map<String,OKey> keys, OTable table) throws ElementExistException {
- final Object lock = new Object();
- String[] names = new String[keys.size()];
- keys.keySet().toArray(names);
- return new OKeyContainer(lock, isCaseSensitive, Arrays.asList(names), keys, table);
- }
-
@Override
protected XPropertySet createDescriptor() {
- return SdbcxKeyDescriptor.create(isCaseSensitive());
+ return new SdbcxKeyDescriptor(isCaseSensitive());
}
@Override
@@ -205,7 +197,7 @@ public class OKeyContainer extends OCont
}
} catch (SQLException sqlException) {
}
- keys.put(newName, OKey.create(newName, isCaseSensitive(), referencedName, keyType, updateRule, deleteRule, new ArrayList<String>(), table));
+ keys.put(newName, new OKey(newName, isCaseSensitive(), referencedName, keyType, updateRule, deleteRule, new ArrayList<String>(), table));
return createObject(newName);
} catch (WrappedTargetException wrappedTargetException) {
} catch (UnknownPropertyException unknownPropertyException) {
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java Sat Sep 16 09:15:21 2017
@@ -164,7 +164,7 @@ public class SqlTableHelper {
pkName = row.getString(6);
}
}
- key = OKey.create(pkName, isCaseSensitive, "", KeyType.PRIMARY, 0, 0, columns, table);
+ key = new OKey(pkName, isCaseSensitive, "", KeyType.PRIMARY, 0, 0, columns, table);
}
return key;
} catch (ElementExistException elementExistException) {
@@ -203,7 +203,7 @@ public class SqlTableHelper {
if (!row.wasNull() && !fkName.isEmpty()) {
if (!oldFkName.equals(fkName)) {
if (keyProperties != null) {
- OKey key = OKey.create(oldFkName, isCaseSensitive, keyProperties.referencedTable, keyProperties.type,
+ OKey key = new OKey(oldFkName, isCaseSensitive, keyProperties.referencedTable, keyProperties.type,
keyProperties.updateRule, keyProperties.deleteRule, keyProperties.columnNames, table);
keys.put(oldFkName, key);
}
@@ -220,7 +220,7 @@ public class SqlTableHelper {
}
}
if (keyProperties != null) {
- OKey key = OKey.create(oldFkName, isCaseSensitive, keyProperties.referencedTable, keyProperties.type,
+ OKey key = new OKey(oldFkName, isCaseSensitive, keyProperties.referencedTable, keyProperties.type,
keyProperties.updateRule, keyProperties.deleteRule, keyProperties.columnNames, table);
keys.put(oldFkName, key);
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java Sat Sep 16 09:15:21 2017
@@ -39,15 +39,11 @@ public class SdbcxColumnDescriptor exten
protected String defaultValue;
protected boolean isCurrency;
- protected SdbcxColumnDescriptor(boolean isCaseSensitive) {
+ public SdbcxColumnDescriptor(boolean isCaseSensitive) {
super("", isCaseSensitive, false);
registerProperties();
}
- public static SdbcxColumnDescriptor create(boolean isCaseSensitive) {
- return new SdbcxColumnDescriptor(isCaseSensitive);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.TYPE.name, PropertyIds.TYPE.id, Type.LONG, (short)0,
new PropertyGetter() {
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java Sat Sep 16 09:15:21 2017
@@ -31,6 +31,6 @@ public class SdbcxColumnDescriptorContai
@Override
protected XPropertySet createDescriptor() {
- return SdbcxColumnDescriptor.create(isCaseSensitive());
+ return new SdbcxColumnDescriptor(isCaseSensitive());
}
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java Sat Sep 16 09:15:21 2017
@@ -29,15 +29,11 @@ import com.sun.star.uno.Type;
public class SdbcxIndexColumnDescriptor extends SdbcxColumnDescriptor {
protected boolean isAscending;
- protected SdbcxIndexColumnDescriptor(boolean isCaseSensitive) {
+ public SdbcxIndexColumnDescriptor(boolean isCaseSensitive) {
super(isCaseSensitive);
registerProperties();
}
- public static SdbcxIndexColumnDescriptor create(boolean isCaseSensitive) {
- return new SdbcxIndexColumnDescriptor(isCaseSensitive);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.ISASCENDING.name, PropertyIds.ISASCENDING.id, Type.BOOLEAN, (short)0,
new PropertyGetter() {
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java Sat Sep 16 09:15:21 2017
@@ -30,6 +30,6 @@ public class SdbcxIndexColumnDescriptorC
@Override
protected XPropertySet createDescriptor() {
- return SdbcxIndexColumnDescriptor.create(isCaseSensitive());
+ return new SdbcxIndexColumnDescriptor(isCaseSensitive());
}
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java Sat Sep 16 09:15:21 2017
@@ -35,16 +35,12 @@ public class SdbcxIndexDescriptor extend
private SdbcxIndexColumnDescriptorContainer columns;
- protected SdbcxIndexDescriptor(boolean isCaseSensitive) {
+ public SdbcxIndexDescriptor(boolean isCaseSensitive) {
super("", isCaseSensitive, false);
columns = new SdbcxIndexColumnDescriptorContainer(this, isCaseSensitive());
registerProperties();
}
- public static SdbcxIndexDescriptor create(boolean isCaseSensitive) {
- return new SdbcxIndexDescriptor(isCaseSensitive);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.CATALOG.name, PropertyIds.CATALOG.id, Type.STRING, (short)0,
new PropertyGetter() {
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java Sat Sep 16 09:15:21 2017
@@ -32,7 +32,7 @@ public class SdbcxIndexDescriptorContain
@Override
protected XPropertySet createDescriptor() {
- return SdbcxIndexDescriptor.create(isCaseSensitive());
+ return new SdbcxIndexDescriptor(isCaseSensitive());
}
@Override
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java Sat Sep 16 09:15:21 2017
@@ -29,15 +29,11 @@ import com.sun.star.uno.Type;
public class SdbcxKeyColumnDescriptor extends SdbcxColumnDescriptor {
protected String relatedColumn;
- protected SdbcxKeyColumnDescriptor(boolean isCaseSensitive) {
+ public SdbcxKeyColumnDescriptor(boolean isCaseSensitive) {
super(isCaseSensitive);
registerProperties();
}
- public static SdbcxKeyColumnDescriptor create(boolean isCaseSensitive) {
- return new SdbcxKeyColumnDescriptor(isCaseSensitive);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.RELATEDCOLUMN.name, PropertyIds.RELATEDCOLUMN.id, Type.STRING, (short)0,
new PropertyGetter() {
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java Sat Sep 16 09:15:21 2017
@@ -30,6 +30,6 @@ public class SdbcxKeyColumnDescriptorCon
@Override
protected XPropertySet createDescriptor() {
- return SdbcxKeyColumnDescriptor.create(isCaseSensitive());
+ return new SdbcxKeyColumnDescriptor(isCaseSensitive());
}
}
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java Sat Sep 16 09:15:21 2017
@@ -37,16 +37,12 @@ public class SdbcxKeyDescriptor extends
private SdbcxKeyColumnDescriptorContainer columns;
- protected SdbcxKeyDescriptor(boolean isCaseSensitive) {
+ public SdbcxKeyDescriptor(boolean isCaseSensitive) {
super("", isCaseSensitive, false);
registerProperties();
columns = new SdbcxKeyColumnDescriptorContainer(this, isCaseSensitive());
}
- public static SdbcxKeyDescriptor create(boolean isCaseSensitive) {
- return new SdbcxKeyDescriptor(isCaseSensitive);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.TYPE.name, PropertyIds.TYPE.id, Type.LONG, (short)0,
new PropertyGetter() {
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java Sat Sep 16 09:15:21 2017
@@ -32,7 +32,7 @@ public class SdbcxKeyDescriptorContainer
@Override
protected XPropertySet createDescriptor() {
- return SdbcxKeyDescriptor.create(isCaseSensitive());
+ return new SdbcxKeyDescriptor(isCaseSensitive());
}
@Override
Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java?rev=1808526&r1=1808525&r2=1808526&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java (original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java Sat Sep 16 09:15:21 2017
@@ -40,17 +40,13 @@ public class SdbcxTableDescriptor extend
private OContainer columns;
private OContainer keys;
- protected SdbcxTableDescriptor(boolean isCaseSensitive) {
+ public SdbcxTableDescriptor(boolean isCaseSensitive) {
super("", isCaseSensitive, false);
columns = new SdbcxColumnDescriptorContainer(this, isCaseSensitive());
keys = new SdbcxKeyDescriptorContainer(this, isCaseSensitive());
registerProperties();
}
- public static SdbcxTableDescriptor create(boolean isCaseSensitive) {
- return new SdbcxTableDescriptor(isCaseSensitive);
- }
-
private void registerProperties() {
registerProperty(PropertyIds.CATALOGNAME.name, PropertyIds.CATALOGNAME.id, Type.STRING, (short)0,
new PropertyGetter() {