Changing license header to Apache for blur-jdbc.
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/4437d316 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/4437d316 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/4437d316 Branch: refs/heads/master Commit: 4437d316657edb5e873a2b68c5423f7785c658f5 Parents: e42b88f Author: Aaron McCurry <[email protected]> Authored: Sun Sep 2 22:06:02 2012 -0400 Committer: Aaron McCurry <[email protected]> Committed: Sun Sep 2 22:06:02 2012 -0400 ---------------------------------------------------------------------- src/blur-jdbc/jar.sh | 17 + src/blur-jdbc/pom.xml | 19 + .../com/nearinfinity/blur/jdbc/BlurConnection.java | 18 +- .../blur/jdbc/BlurDatabaseMetaData.java | 18 +- .../java/com/nearinfinity/blur/jdbc/BlurJdbc.java | 16 + .../blur/jdbc/BlurPreparedStatement.java | 18 +- .../blur/jdbc/BlurResultSetMetaData.java | 16 + .../blur/jdbc/BlurResultSetRecords.java | 16 + .../nearinfinity/blur/jdbc/BlurResultSetRows.java | 16 + .../nearinfinity/blur/jdbc/BlurResultSetTest.java | 26 +- .../com/nearinfinity/blur/jdbc/BlurStatement.java | 16 + .../com/nearinfinity/blur/jdbc/BlurWarnings.java | 18 +- .../java/com/nearinfinity/blur/jdbc/QueryData.java | 118 +- .../jdbc/abstractimpl/AbstractBlurConnection.java | 386 +++--- .../abstractimpl/AbstractBlurDatabaseMetaData.java | 1275 +++++++-------- .../AbstractBlurPreparedStatement.java | 18 +- .../jdbc/abstractimpl/AbstractBlurResultSet.java | 1234 +++++++------- .../AbstractBlurResultSetMetaData.java | 228 ++-- .../jdbc/abstractimpl/AbstractBlurStatement.java | 345 ++-- .../com/nearinfinity/blur/jdbc/parser/Parser.java | 24 +- .../blur/jdbc/util/EmptyResultSet.java | 42 +- .../blur/jdbc/util/EmptyResultSetMetaData.java | 26 +- .../blur/jdbc/util/NotImplemented.java | 46 +- .../blur/jdbc/util/SimpleStringResultSet.java | 130 +- .../blur/jdbc/grammar/BlurParserTest.java | 148 -- 25 files changed, 2218 insertions(+), 2016 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/jar.sh ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/jar.sh b/src/blur-jdbc/jar.sh index 16e0418..e2f70ae 100755 --- a/src/blur-jdbc/jar.sh +++ b/src/blur-jdbc/jar.sh @@ -1 +1,18 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + mvn assembly:assembly -DdescriptorId=jar-with-dependencies http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/pom.xml ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/pom.xml b/src/blur-jdbc/pom.xml index d8d3506..bd1591e 100644 --- a/src/blur-jdbc/pom.xml +++ b/src/blur-jdbc/pom.xml @@ -1,3 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurConnection.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurConnection.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurConnection.java index cc21b61..19b2b55 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurConnection.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurConnection.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -47,7 +63,7 @@ public class BlurConnection extends AbstractBlurConnection { @Override public PreparedStatement prepareStatement(String sql) throws SQLException { - return new BlurPreparedStatement(this,sql); + return new BlurPreparedStatement(this, sql); } @Override http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurDatabaseMetaData.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurDatabaseMetaData.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurDatabaseMetaData.java index 665387a..cd18cc7 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurDatabaseMetaData.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurDatabaseMetaData.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.sql.Connection; import java.sql.ResultSet; import java.sql.RowIdLifetime; @@ -108,8 +124,6 @@ public class BlurDatabaseMetaData extends AbstractBlurDatabaseMetaData { } return new TableDescriptorResultSet(data); } - - @Override public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException { http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurJdbc.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurJdbc.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurJdbc.java index 92999da..18764af 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurJdbc.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurJdbc.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.sql.Connection; import java.sql.Driver; import java.sql.DriverPropertyInfo; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurPreparedStatement.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurPreparedStatement.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurPreparedStatement.java index 08b59ed..94eb07b 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurPreparedStatement.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurPreparedStatement.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.sql.ResultSet; import java.sql.SQLException; @@ -24,5 +40,5 @@ public class BlurPreparedStatement extends AbstractBlurPreparedStatement { public ResultSet getResultSet() throws SQLException { return blurStatement.getResultSet(); } - + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetMetaData.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetMetaData.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetMetaData.java index cd290ce..ae642d1 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetMetaData.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetMetaData.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Types; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRecords.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRecords.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRecords.java index d179d92..6a42fe6 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRecords.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRecords.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import static com.nearinfinity.blur.jdbc.BlurResultSetMetaData.FAMILY; import static com.nearinfinity.blur.jdbc.BlurResultSetMetaData.LOCATIONID; import static com.nearinfinity.blur.jdbc.BlurResultSetMetaData.RECORDID; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRows.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRows.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRows.java index 6fe15ad..2a1fd41 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRows.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetRows.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import static com.nearinfinity.blur.jdbc.BlurResultSetMetaData.FAMILY; import static com.nearinfinity.blur.jdbc.BlurResultSetMetaData.LOCATIONID; import static com.nearinfinity.blur.jdbc.BlurResultSetMetaData.RECORDID; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetTest.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetTest.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetTest.java index 24c00ea..e594991 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetTest.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurResultSetTest.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.sql.ResultSetMetaData; import java.util.List; @@ -12,16 +28,16 @@ import com.nearinfinity.blur.thrift.generated.Blur.Iface; public class BlurResultSetTest { public static void main(String[] args) throws Exception { -// String sql = "select * from test-table.fam0 where fam0.col0 = 'abroad'"; + // String sql = "select * from test-table.fam0 where fam0.col0 = 'abroad'"; String sql = "select * from test-table.fam0"; List<Connection> connections = BlurClientManager.getConnections("10.192.56.10:40010"); -// BlurResultSetRows resultSet = new BlurResultSetRows(sql,connections); - + // BlurResultSetRows resultSet = new BlurResultSetRows(sql,connections); + Iface client = BlurClient.getClient(connections); Parser parser = new Parser(); parser.parse(sql); - - BlurResultSetRecords resultSet = new BlurResultSetRecords(client,parser); + + BlurResultSetRecords resultSet = new BlurResultSetRecords(client, parser); int c = 0; while (resultSet.next()) { System.out.println(c + " ------------------------"); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurStatement.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurStatement.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurStatement.java index 7e90ede..9b0a54f 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurStatement.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurStatement.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurWarnings.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurWarnings.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurWarnings.java index dc0eb6b..151bb4d 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurWarnings.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/BlurWarnings.java @@ -1,9 +1,25 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.sql.SQLWarning; public class BlurWarnings extends SQLWarning { - private static final long serialVersionUID = 9142092749428230656L; + private static final long serialVersionUID = 9142092749428230656L; } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/QueryData.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/QueryData.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/QueryData.java index 19643cc..22eca86 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/QueryData.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/QueryData.java @@ -1,56 +1,72 @@ package com.nearinfinity.blur.jdbc; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ public class QueryData { - protected String name; - protected String alias; - - public QueryData(String name, String alias) { - this.name = name; - this.alias = alias; - } - - public String getName() { - return name; - } - - public String getAlias() { - return alias; - } - - @Override - public String toString() { - return "QueryData [name=" + name + ", alias=" + alias + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((alias == null) ? 0 : alias.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - QueryData other = (QueryData) obj; - if (alias == null) { - if (other.alias != null) - return false; - } else if (!alias.equals(other.alias)) - return false; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - return true; - } + protected String name; + protected String alias; + + public QueryData(String name, String alias) { + this.name = name; + this.alias = alias; + } + + public String getName() { + return name; + } + + public String getAlias() { + return alias; + } + + @Override + public String toString() { + return "QueryData [name=" + name + ", alias=" + alias + "]"; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((alias == null) ? 0 : alias.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + QueryData other = (QueryData) obj; + if (alias == null) { + if (other.alias != null) + return false; + } else if (!alias.equals(other.alias)) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + return true; + } } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/4437d316/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/abstractimpl/AbstractBlurConnection.java ---------------------------------------------------------------------- diff --git a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/abstractimpl/AbstractBlurConnection.java b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/abstractimpl/AbstractBlurConnection.java index 8f32189..56fde9d 100644 --- a/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/abstractimpl/AbstractBlurConnection.java +++ b/src/blur-jdbc/src/main/java/com/nearinfinity/blur/jdbc/abstractimpl/AbstractBlurConnection.java @@ -1,5 +1,21 @@ package com.nearinfinity.blur.jdbc.abstractimpl; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; @@ -24,216 +40,212 @@ import java.util.Properties; import com.nearinfinity.blur.jdbc.util.NotImplemented; public abstract class AbstractBlurConnection implements Connection { - - private Connection throwExceptionDelegate; - - public AbstractBlurConnection() { - throwExceptionDelegate = (Connection) Proxy.newProxyInstance(Connection.class.getClassLoader(), - new Class[] { Connection.class }, - new InvocationHandler() { - @Override - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - throw new NotImplemented(method.getName()); - } - }); - } - - public void clearWarnings() throws SQLException { - throwExceptionDelegate.clearWarnings(); - } - - public void close() throws SQLException { - throwExceptionDelegate.close(); - } - - public void commit() throws SQLException { - throwExceptionDelegate.commit(); - } - - public Array createArrayOf(String arg0, Object[] arg1) throws SQLException { - return throwExceptionDelegate.createArrayOf(arg0, arg1); - } - - public Blob createBlob() throws SQLException { - return throwExceptionDelegate.createBlob(); - } - - public Clob createClob() throws SQLException { - return throwExceptionDelegate.createClob(); - } - - public NClob createNClob() throws SQLException { - return throwExceptionDelegate.createNClob(); - } - - public SQLXML createSQLXML() throws SQLException { - return throwExceptionDelegate.createSQLXML(); - } - - public Statement createStatement() throws SQLException { - return throwExceptionDelegate.createStatement(); - } - - public Statement createStatement(int arg0, int arg1, int arg2) throws SQLException { - return throwExceptionDelegate.createStatement(arg0, arg1, arg2); - } - - public Statement createStatement(int arg0, int arg1) throws SQLException { - return throwExceptionDelegate.createStatement(arg0, arg1); - } - - public Struct createStruct(String arg0, Object[] arg1) throws SQLException { - return throwExceptionDelegate.createStruct(arg0, arg1); - } - - public boolean getAutoCommit() throws SQLException { - return throwExceptionDelegate.getAutoCommit(); - } - - public String getCatalog() throws SQLException { - return throwExceptionDelegate.getCatalog(); - } - - public Properties getClientInfo() throws SQLException { - return throwExceptionDelegate.getClientInfo(); - } - - public String getClientInfo(String arg0) throws SQLException { - return throwExceptionDelegate.getClientInfo(arg0); - } - - public int getHoldability() throws SQLException { - return throwExceptionDelegate.getHoldability(); - } - - public DatabaseMetaData getMetaData() throws SQLException { - return throwExceptionDelegate.getMetaData(); - } - - public int getTransactionIsolation() throws SQLException { - return throwExceptionDelegate.getTransactionIsolation(); - } - - public Map<String, Class<?>> getTypeMap() throws SQLException { - return throwExceptionDelegate.getTypeMap(); - } - - public SQLWarning getWarnings() throws SQLException { - return throwExceptionDelegate.getWarnings(); - } - - public boolean isClosed() throws SQLException { - return throwExceptionDelegate.isClosed(); - } - - public boolean isReadOnly() throws SQLException { - return throwExceptionDelegate.isReadOnly(); - } - - public boolean isValid(int arg0) throws SQLException { - return throwExceptionDelegate.isValid(arg0); - } - - public boolean isWrapperFor(Class<?> iface) throws SQLException { - return throwExceptionDelegate.isWrapperFor(iface); - } - public String nativeSQL(String arg0) throws SQLException { - return throwExceptionDelegate.nativeSQL(arg0); - } + private Connection throwExceptionDelegate; - public CallableStatement prepareCall(String arg0, int arg1, int arg2, int arg3) throws SQLException { - return throwExceptionDelegate.prepareCall(arg0, arg1, arg2, arg3); - } + public AbstractBlurConnection() { + throwExceptionDelegate = (Connection) Proxy.newProxyInstance(Connection.class.getClassLoader(), new Class[] { Connection.class }, new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + throw new NotImplemented(method.getName()); + } + }); + } - public CallableStatement prepareCall(String arg0, int arg1, int arg2) throws SQLException { - return throwExceptionDelegate.prepareCall(arg0, arg1, arg2); - } + public void clearWarnings() throws SQLException { + throwExceptionDelegate.clearWarnings(); + } - public CallableStatement prepareCall(String arg0) throws SQLException { - return throwExceptionDelegate.prepareCall(arg0); - } + public void close() throws SQLException { + throwExceptionDelegate.close(); + } - public PreparedStatement prepareStatement(String arg0, int arg1, int arg2, int arg3) throws SQLException { - return throwExceptionDelegate.prepareStatement(arg0, arg1, arg2, arg3); - } + public void commit() throws SQLException { + throwExceptionDelegate.commit(); + } - public PreparedStatement prepareStatement(String arg0, int arg1, int arg2) throws SQLException { - return throwExceptionDelegate.prepareStatement(arg0, arg1, arg2); - } + public Array createArrayOf(String arg0, Object[] arg1) throws SQLException { + return throwExceptionDelegate.createArrayOf(arg0, arg1); + } - public PreparedStatement prepareStatement(String arg0, int arg1) throws SQLException { - return throwExceptionDelegate.prepareStatement(arg0, arg1); - } + public Blob createBlob() throws SQLException { + return throwExceptionDelegate.createBlob(); + } - public PreparedStatement prepareStatement(String arg0, int[] arg1) throws SQLException { - return throwExceptionDelegate.prepareStatement(arg0, arg1); - } + public Clob createClob() throws SQLException { + return throwExceptionDelegate.createClob(); + } - public PreparedStatement prepareStatement(String arg0, String[] arg1) throws SQLException { - return throwExceptionDelegate.prepareStatement(arg0, arg1); - } + public NClob createNClob() throws SQLException { + return throwExceptionDelegate.createNClob(); + } - public PreparedStatement prepareStatement(String arg0) throws SQLException { - return throwExceptionDelegate.prepareStatement(arg0); - } + public SQLXML createSQLXML() throws SQLException { + return throwExceptionDelegate.createSQLXML(); + } - public void releaseSavepoint(Savepoint arg0) throws SQLException { - throwExceptionDelegate.releaseSavepoint(arg0); - } + public Statement createStatement() throws SQLException { + return throwExceptionDelegate.createStatement(); + } - public void rollback() throws SQLException { - throwExceptionDelegate.rollback(); - } + public Statement createStatement(int arg0, int arg1, int arg2) throws SQLException { + return throwExceptionDelegate.createStatement(arg0, arg1, arg2); + } - public void rollback(Savepoint arg0) throws SQLException { - throwExceptionDelegate.rollback(arg0); - } + public Statement createStatement(int arg0, int arg1) throws SQLException { + return throwExceptionDelegate.createStatement(arg0, arg1); + } - public void setAutoCommit(boolean arg0) throws SQLException { - throwExceptionDelegate.setAutoCommit(arg0); - } + public Struct createStruct(String arg0, Object[] arg1) throws SQLException { + return throwExceptionDelegate.createStruct(arg0, arg1); + } - public void setCatalog(String arg0) throws SQLException { - throwExceptionDelegate.setCatalog(arg0); - } + public boolean getAutoCommit() throws SQLException { + return throwExceptionDelegate.getAutoCommit(); + } - public void setClientInfo(Properties arg0) throws SQLClientInfoException { - throwExceptionDelegate.setClientInfo(arg0); - } + public String getCatalog() throws SQLException { + return throwExceptionDelegate.getCatalog(); + } - public void setClientInfo(String arg0, String arg1) throws SQLClientInfoException { - throwExceptionDelegate.setClientInfo(arg0, arg1); - } + public Properties getClientInfo() throws SQLException { + return throwExceptionDelegate.getClientInfo(); + } - public void setHoldability(int arg0) throws SQLException { - throwExceptionDelegate.setHoldability(arg0); - } + public String getClientInfo(String arg0) throws SQLException { + return throwExceptionDelegate.getClientInfo(arg0); + } - public void setReadOnly(boolean arg0) throws SQLException { - throwExceptionDelegate.setReadOnly(arg0); - } + public int getHoldability() throws SQLException { + return throwExceptionDelegate.getHoldability(); + } - public Savepoint setSavepoint() throws SQLException { - return throwExceptionDelegate.setSavepoint(); - } + public DatabaseMetaData getMetaData() throws SQLException { + return throwExceptionDelegate.getMetaData(); + } - public Savepoint setSavepoint(String arg0) throws SQLException { - return throwExceptionDelegate.setSavepoint(arg0); - } + public int getTransactionIsolation() throws SQLException { + return throwExceptionDelegate.getTransactionIsolation(); + } - public void setTransactionIsolation(int arg0) throws SQLException { - throwExceptionDelegate.setTransactionIsolation(arg0); - } + public Map<String, Class<?>> getTypeMap() throws SQLException { + return throwExceptionDelegate.getTypeMap(); + } - public void setTypeMap(Map<String, Class<?>> arg0) throws SQLException { - throwExceptionDelegate.setTypeMap(arg0); - } + public SQLWarning getWarnings() throws SQLException { + return throwExceptionDelegate.getWarnings(); + } - public <T> T unwrap(Class<T> iface) throws SQLException { - return throwExceptionDelegate.unwrap(iface); - } - - + public boolean isClosed() throws SQLException { + return throwExceptionDelegate.isClosed(); + } + + public boolean isReadOnly() throws SQLException { + return throwExceptionDelegate.isReadOnly(); + } + + public boolean isValid(int arg0) throws SQLException { + return throwExceptionDelegate.isValid(arg0); + } + + public boolean isWrapperFor(Class<?> iface) throws SQLException { + return throwExceptionDelegate.isWrapperFor(iface); + } + + public String nativeSQL(String arg0) throws SQLException { + return throwExceptionDelegate.nativeSQL(arg0); + } + + public CallableStatement prepareCall(String arg0, int arg1, int arg2, int arg3) throws SQLException { + return throwExceptionDelegate.prepareCall(arg0, arg1, arg2, arg3); + } + + public CallableStatement prepareCall(String arg0, int arg1, int arg2) throws SQLException { + return throwExceptionDelegate.prepareCall(arg0, arg1, arg2); + } + + public CallableStatement prepareCall(String arg0) throws SQLException { + return throwExceptionDelegate.prepareCall(arg0); + } + + public PreparedStatement prepareStatement(String arg0, int arg1, int arg2, int arg3) throws SQLException { + return throwExceptionDelegate.prepareStatement(arg0, arg1, arg2, arg3); + } + + public PreparedStatement prepareStatement(String arg0, int arg1, int arg2) throws SQLException { + return throwExceptionDelegate.prepareStatement(arg0, arg1, arg2); + } + + public PreparedStatement prepareStatement(String arg0, int arg1) throws SQLException { + return throwExceptionDelegate.prepareStatement(arg0, arg1); + } + + public PreparedStatement prepareStatement(String arg0, int[] arg1) throws SQLException { + return throwExceptionDelegate.prepareStatement(arg0, arg1); + } + + public PreparedStatement prepareStatement(String arg0, String[] arg1) throws SQLException { + return throwExceptionDelegate.prepareStatement(arg0, arg1); + } + + public PreparedStatement prepareStatement(String arg0) throws SQLException { + return throwExceptionDelegate.prepareStatement(arg0); + } + + public void releaseSavepoint(Savepoint arg0) throws SQLException { + throwExceptionDelegate.releaseSavepoint(arg0); + } + + public void rollback() throws SQLException { + throwExceptionDelegate.rollback(); + } + + public void rollback(Savepoint arg0) throws SQLException { + throwExceptionDelegate.rollback(arg0); + } + + public void setAutoCommit(boolean arg0) throws SQLException { + throwExceptionDelegate.setAutoCommit(arg0); + } + + public void setCatalog(String arg0) throws SQLException { + throwExceptionDelegate.setCatalog(arg0); + } + + public void setClientInfo(Properties arg0) throws SQLClientInfoException { + throwExceptionDelegate.setClientInfo(arg0); + } + + public void setClientInfo(String arg0, String arg1) throws SQLClientInfoException { + throwExceptionDelegate.setClientInfo(arg0, arg1); + } + + public void setHoldability(int arg0) throws SQLException { + throwExceptionDelegate.setHoldability(arg0); + } + + public void setReadOnly(boolean arg0) throws SQLException { + throwExceptionDelegate.setReadOnly(arg0); + } + + public Savepoint setSavepoint() throws SQLException { + return throwExceptionDelegate.setSavepoint(); + } + + public Savepoint setSavepoint(String arg0) throws SQLException { + return throwExceptionDelegate.setSavepoint(arg0); + } + + public void setTransactionIsolation(int arg0) throws SQLException { + throwExceptionDelegate.setTransactionIsolation(arg0); + } + + public void setTypeMap(Map<String, Class<?>> arg0) throws SQLException { + throwExceptionDelegate.setTypeMap(arg0); + } + + public <T> T unwrap(Class<T> iface) throws SQLException { + return throwExceptionDelegate.unwrap(iface); + } }
