Changeset 108:db1fdb678d67
- Timestamp:
- 05/13/09 14:42:12 (15 months ago)
- Author:
- ryan@…
- Branch:
- default
- Tags:
- tip
- Message:
-
Upgrade to Google Collections 1.0-rc1
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r104
|
r108
|
|
| 48 | 48 | |
| 49 | 49 | <dependency> |
| 50 | | <groupId>com.google.common</groupId> |
| 51 | | <artifactId>google-collect</artifactId> |
| 52 | | <version>0.7-20080602</version> |
| | 50 | <groupId>com.google.collections</groupId> |
| | 51 | <artifactId>google-collections</artifactId> |
| | 52 | <version>1.0-rc1</version> |
| 53 | 53 | <scope>compile</scope> |
| 54 | 54 | </dependency> |
| … |
… |
|
| 64 | 64 | <groupId>org.springframework</groupId> |
| 65 | 65 | <artifactId>spring</artifactId> |
| 66 | | <version>2.5.5</version> |
| | 66 | <version>2.5.6</version> |
| 67 | 67 | <scope>test</scope> |
| 68 | 68 | </dependency> |
| … |
… |
|
| 71 | 71 | <groupId>org.springframework</groupId> |
| 72 | 72 | <artifactId>spring-test</artifactId> |
| 73 | | <version>2.5.5</version> |
| | 73 | <version>2.5.6</version> |
| 74 | 74 | <scope>test</scope> |
| 75 | 75 | </dependency> |
-
|
r67
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel; |
| 17 | 17 | |
| | 18 | import com.google.common.collect.ImmutableList; |
| | 19 | import static com.google.common.collect.Iterables.concat; |
| 18 | 20 | import com.thimbleware.jrel.expr.operators.Condition; |
| 19 | 21 | import com.thimbleware.jrel.schema.Table; |
| 20 | | import com.google.common.collect.Iterables; |
| 21 | | import com.google.common.collect.Lists; |
| 22 | | import com.google.common.collect.ImmutableList; |
| 23 | | import static com.google.common.collect.Lists.*; |
| 24 | | import static com.google.common.collect.Iterables.*; |
| 25 | 22 | |
| 26 | 23 | import java.util.ArrayList; |
-
|
r86
|
r108
|
|
| 17 | 17 | |
| 18 | 18 | import com.thimbleware.jrel.expr.*; |
| | 19 | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| | 20 | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 19 | 21 | import com.thimbleware.jrel.expr.attributes.WildcardAttribute; |
| 20 | | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 21 | | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| 22 | | import com.thimbleware.jrel.expr.operators.UnaryOperator; |
| 23 | 22 | import com.thimbleware.jrel.expr.operators.BinaryOperator; |
| 24 | 23 | import com.thimbleware.jrel.expr.operators.Condition; |
| | 24 | import com.thimbleware.jrel.expr.operators.UnaryOperator; |
| 25 | 25 | import com.thimbleware.jrel.schema.NamedRelation; |
| 26 | 26 | import com.thimbleware.jrel.util.Pair; |
-
|
r88
|
r108
|
|
| 17 | 17 | |
| 18 | 18 | import com.thimbleware.jrel.schema.RelVar; |
| 19 | | import com.thimbleware.jrel.schema.TableDomain; |
| 20 | 19 | import com.thimbleware.jrel.schema.Table; |
| | 20 | import com.thimbleware.jrel.schema.TupleDomain; |
| 21 | 21 | import com.thimbleware.jrel.schema.TupleVar; |
| 22 | | import com.thimbleware.jrel.schema.Domain; |
| 23 | | import com.thimbleware.jrel.schema.RelationDomain; |
| 24 | | import com.thimbleware.jrel.schema.TupleDomain; |
| 25 | 22 | |
| 26 | 23 | /** |
-
|
r90
|
r108
|
|
| 18 | 18 | import com.google.common.base.Function; |
| 19 | 19 | import com.google.common.collect.Iterables; |
| 20 | | import com.thimbleware.jrel.expr.operators.Condition; |
| 21 | 20 | import com.thimbleware.jrel.expr.attributes.Attribute; |
| 22 | 21 | import com.thimbleware.jrel.expr.attributes.NamedAttribute; |
| | 22 | import com.thimbleware.jrel.expr.operators.Condition; |
| | 23 | import com.thimbleware.jrel.schema.Domain; |
| 23 | 24 | import com.thimbleware.jrel.schema.NamedRelation; |
| 24 | 25 | import com.thimbleware.jrel.schema.Relation; |
| 25 | | import com.thimbleware.jrel.schema.Domain; |
| 26 | 26 | import com.thimbleware.jrel.schema.RelationDomain; |
| 27 | 27 | |
-
|
r92
|
r108
|
|
| 17 | 17 | |
| 18 | 18 | import com.google.common.base.Function; |
| 19 | | import com.google.common.base.Nullable; |
| 20 | 19 | import com.google.common.base.Predicate; |
| 21 | 20 | import com.google.common.collect.ImmutableList; |
| 22 | | import static com.google.common.collect.Lists.*; |
| 23 | 21 | import static com.google.common.collect.Iterables.*; |
| | 22 | import static com.google.common.collect.Lists.asList; |
| | 23 | import static com.google.common.collect.Lists.newArrayList; |
| 24 | 24 | import com.thimbleware.jrel.exceptions.*; |
| | 25 | import com.thimbleware.jrel.expr.CompoundExpression; |
| | 26 | import com.thimbleware.jrel.expr.Expression; |
| | 27 | import com.thimbleware.jrel.expr.attributes.*; |
| 25 | 28 | import com.thimbleware.jrel.expr.operators.Condition; |
| 26 | | import com.thimbleware.jrel.expr.*; |
| 27 | | import com.thimbleware.jrel.expr.attributes.WildcardAttribute; |
| 28 | | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 29 | | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| 30 | | import com.thimbleware.jrel.expr.attributes.Attribute; |
| 31 | | import com.thimbleware.jrel.expr.attributes.NamedAttribute; |
| 32 | | import com.thimbleware.jrel.expr.attributes.AliasedAttribute; |
| 33 | 29 | import com.thimbleware.jrel.schema.*; |
| | 30 | import static com.thimbleware.jrel.util.Functional.exists; |
| 34 | 31 | import com.thimbleware.jrel.util.Matcher; |
| 35 | | import static com.thimbleware.jrel.util.Functional.*; |
| 36 | | |
| 37 | | import java.util.*; |
| | 32 | |
| | 33 | import java.util.ArrayList; |
| | 34 | import java.util.Collection; |
| | 35 | import java.util.List; |
| | 36 | import java.util.NoSuchElementException; |
| 38 | 37 | |
| 39 | 38 | /** |
| … |
… |
|
| 202 | 201 | try { |
| 203 | 202 | find(attrs, new Predicate<RelationAttribute>() { |
| 204 | | public boolean apply(@Nullable RelationAttribute attribute) { |
| | 203 | public boolean apply(RelationAttribute attribute) { |
| 205 | 204 | return allRelations.contains(attribute.getRelation()); |
| 206 | 205 | } |
| … |
… |
|
| 513 | 512 | Iterable<Relation> allRelations() { |
| 514 | 513 | return concat(getRelations(), concat(transform(getJoins(), new Function<JoinClause, Iterable<NamedRelation>>() { |
| 515 | | public Iterable<NamedRelation> apply(@Nullable JoinClause joinClause) { |
| | 514 | public Iterable<NamedRelation> apply(JoinClause joinClause) { |
| 516 | 515 | return ImmutableList.of(joinClause.leftRelation, joinClause.rightRelation); |
| 517 | 516 | } |
| … |
… |
|
| 579 | 578 | public boolean hasAttribute(final Attribute attr) { |
| 580 | 579 | return exists(projectedDomain, new Predicate<Attribute>() { |
| 581 | | public boolean apply(@Nullable Attribute attribute) { |
| | 580 | public boolean apply(Attribute attribute) { |
| 582 | 581 | return attr.equals(attribute) || attribute.equals(attr); |
| 583 | 582 | } |
| 584 | 583 | }) || exists(relations, new Predicate<Relation>() { |
| 585 | | public boolean apply(@Nullable Relation relation) { |
| | 584 | public boolean apply(Relation relation) { |
| 586 | 585 | return relation.getDomain().hasAttribute(attr); |
| 587 | 586 | } |
| 588 | 587 | }) || exists(joins, new Predicate<JoinClause>() { |
| 589 | | public boolean apply(@Nullable JoinClause joinClause) { |
| | 588 | public boolean apply(JoinClause joinClause) { |
| 590 | 589 | return joinClause.getDomain().hasAttribute(attr); |
| 591 | 590 | } |
| … |
… |
|
| 595 | 594 | public boolean hasAttribute(final String attributeName) { |
| 596 | 595 | return exists(projectedDomain, new Predicate<Attribute>() { |
| 597 | | public boolean apply(@Nullable Attribute attribute) { |
| | 596 | public boolean apply(Attribute attribute) { |
| 598 | 597 | return (attribute instanceof NamedAttribute && |
| 599 | 598 | (attributeName.equals(((NamedAttribute)attribute).getName()))); |
| 600 | 599 | } |
| 601 | 600 | }) || exists(relations, new Predicate<Relation>() { |
| 602 | | public boolean apply(@Nullable Relation relation) { |
| | 601 | public boolean apply(Relation relation) { |
| 603 | 602 | return (relation.getDomain().hasAttribute(attributeName)); |
| 604 | 603 | } |
| 605 | 604 | }) || exists(joins, new Predicate<JoinClause>() { |
| 606 | | public boolean apply(@Nullable JoinClause joinClause) { |
| | 605 | public boolean apply(JoinClause joinClause) { |
| 607 | 606 | return (joinClause.getDomain().hasAttribute(attributeName)); |
| 608 | 607 | } |
-
|
r84
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel; |
| 17 | 17 | |
| 18 | | import com.thimbleware.jrel.expr.*; |
| 19 | | import com.thimbleware.jrel.expr.attributes.TableAttribute; |
| 20 | | import com.thimbleware.jrel.expr.attributes.WildcardAttribute; |
| 21 | | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 22 | | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| 23 | | import com.thimbleware.jrel.expr.attributes.AliasedAttribute; |
| | 18 | import com.thimbleware.jrel.expr.CompoundExpression; |
| | 19 | import com.thimbleware.jrel.expr.ConditionalExpression; |
| | 20 | import com.thimbleware.jrel.expr.FunctionApplication; |
| | 21 | import com.thimbleware.jrel.expr.SubQuery; |
| | 22 | import com.thimbleware.jrel.expr.attributes.*; |
| | 23 | import com.thimbleware.jrel.expr.literals.*; |
| 24 | 24 | import com.thimbleware.jrel.expr.operators.BinaryOperator; |
| | 25 | import com.thimbleware.jrel.expr.operators.CastOperator; |
| 25 | 26 | import com.thimbleware.jrel.expr.operators.Condition; |
| 26 | 27 | import com.thimbleware.jrel.expr.operators.UnaryOperator; |
| 27 | | import com.thimbleware.jrel.expr.operators.CastOperator; |
| 28 | | import com.thimbleware.jrel.expr.literals.*; |
| | 28 | import com.thimbleware.jrel.schema.RelVar; |
| | 29 | import com.thimbleware.jrel.schema.Subselect; |
| 29 | 30 | import com.thimbleware.jrel.schema.Table; |
| 30 | | import com.thimbleware.jrel.schema.Subselect; |
| 31 | | import com.thimbleware.jrel.schema.RelVar; |
| 32 | 31 | |
| 33 | 32 | /** |
-
|
r84
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel; |
| 17 | 17 | |
| | 18 | import com.google.common.collect.ImmutableList; |
| | 19 | import static com.google.common.collect.Iterables.concat; |
| 18 | 20 | import com.thimbleware.jrel.expr.Assignment; |
| 19 | 21 | import com.thimbleware.jrel.expr.Expression; |
| … |
… |
|
| 22 | 24 | import com.thimbleware.jrel.expr.operators.Op; |
| 23 | 25 | import com.thimbleware.jrel.schema.Table; |
| 24 | | import com.google.common.collect.ImmutableList; |
| 25 | | import static com.google.common.collect.Iterables.*; |
| 26 | 26 | |
| 27 | 27 | import java.util.ArrayList; |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr; |
| 17 | 17 | |
| | 18 | import com.thimbleware.jrel.expr.attributes.AliasedAttribute; |
| | 19 | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| 18 | 20 | import com.thimbleware.jrel.expr.operators.BinaryOperator; |
| | 21 | import com.thimbleware.jrel.expr.operators.Condition; |
| 19 | 22 | import com.thimbleware.jrel.expr.operators.Op; |
| 20 | | import com.thimbleware.jrel.expr.operators.Condition; |
| 21 | | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| 22 | | import com.thimbleware.jrel.expr.attributes.Attribute; |
| 23 | | import com.thimbleware.jrel.expr.attributes.AliasedAttribute; |
| 24 | 23 | |
| 25 | 24 | /** |
-
|
r88
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr; |
| 17 | 17 | |
| 18 | | import com.thimbleware.jrel.expr.attributes.Attribute; |
| 19 | | import com.thimbleware.jrel.expr.attributes.TableAttribute; |
| 20 | 18 | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 21 | 19 | |
-
|
r88
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr; |
| 17 | 17 | |
| | 18 | import com.thimbleware.jrel.QueryVisitor; |
| 18 | 19 | import com.thimbleware.jrel.expr.operators.Condition; |
| 19 | 20 | import com.thimbleware.jrel.expr.operators.Op; |
| 20 | | import com.thimbleware.jrel.QueryVisitor; |
| 21 | 21 | import com.thimbleware.jrel.util.Pair; |
| 22 | 22 | |
| | 23 | import java.util.ArrayList; |
| 23 | 24 | import java.util.List; |
| 24 | | import java.util.ArrayList; |
| 25 | 25 | |
| 26 | 26 | /** |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr; |
| 17 | 17 | |
| | 18 | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| | 19 | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| | 20 | import com.thimbleware.jrel.expr.attributes.WildcardAttribute; |
| 18 | 21 | import com.thimbleware.jrel.expr.operators.BinaryOperator; |
| 19 | 22 | import com.thimbleware.jrel.expr.operators.UnaryOperator; |
| 20 | | import com.thimbleware.jrel.expr.attributes.WildcardAttribute; |
| 21 | | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 22 | | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| 23 | 23 | |
| 24 | 24 | /** |
-
|
r90
|
r108
|
|
| 17 | 17 | |
| 18 | 18 | import com.google.common.base.Function; |
| 19 | | import com.google.common.base.Nullable; |
| 20 | 19 | import com.google.common.collect.ImmutableList; |
| 21 | 20 | import static com.google.common.collect.Iterables.transform; |
| … |
… |
|
| 54 | 53 | public FunctionApplication renameNamedRelationIf(final String oldAlias, final String newAlias) { |
| 55 | 54 | return new FunctionApplication(functionName, transform(arguments, new Function<Expression, Expression>() { |
| 56 | | public Expression apply(@Nullable Expression expression) { |
| | 55 | public Expression apply(Expression expression) { |
| 57 | 56 | return expression.renameNamedRelationIf(oldAlias, newAlias); |
| 58 | 57 | } |
-
|
r90
|
r108
|
|
| 15 | 15 | */ |
| 16 | 16 | package com.thimbleware.jrel.expr; |
| 17 | | |
| 18 | | import com.thimbleware.jrel.exceptions.UnsupportedTypeException; |
| 19 | | import com.thimbleware.jrel.expr.literals.*; |
| 20 | 17 | |
| 21 | 18 | /** |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr; |
| 17 | 17 | |
| | 18 | import com.thimbleware.jrel.Query; |
| 18 | 19 | import com.thimbleware.jrel.QueryVisitor; |
| 19 | | import com.thimbleware.jrel.Query; |
| 20 | 20 | import com.thimbleware.jrel.exceptions.IncorrectCardinalityOfProjectionException; |
| 21 | 21 | |
-
|
r95
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr.attributes; |
| 17 | 17 | |
| 18 | | import com.thimbleware.jrel.schema.NamedRelation; |
| 19 | 18 | import com.thimbleware.jrel.QueryVisitor; |
| 20 | 19 | import com.thimbleware.jrel.expr.ExpressionVisitor; |
| | 20 | import com.thimbleware.jrel.schema.NamedRelation; |
| 21 | 21 | |
| 22 | 22 | /** |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr.attributes; |
| 17 | 17 | |
| 18 | | import com.thimbleware.jrel.schema.NamedRelation; |
| 19 | 18 | import com.thimbleware.jrel.QueryVisitor; |
| 20 | 19 | import com.thimbleware.jrel.expr.ExpressionVisitor; |
| | 20 | import com.thimbleware.jrel.schema.NamedRelation; |
| 21 | 21 | |
| 22 | 22 | /** |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr.literals; |
| 17 | 17 | |
| | 18 | import com.thimbleware.jrel.QueryVisitor; |
| 18 | 19 | import com.thimbleware.jrel.expr.Literal; |
| 19 | | import com.thimbleware.jrel.QueryVisitor; |
| 20 | 20 | |
| 21 | 21 | import java.util.Date; |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr.literals; |
| 17 | 17 | |
| | 18 | import com.google.common.collect.ImmutableList; |
| | 19 | import com.google.common.collect.Iterables; |
| | 20 | import com.thimbleware.jrel.QueryVisitor; |
| 18 | 21 | import com.thimbleware.jrel.expr.Literal; |
| 19 | | import com.thimbleware.jrel.expr.Expression; |
| 20 | | import com.thimbleware.jrel.expr.operators.Op; |
| 21 | | import com.thimbleware.jrel.QueryVisitor; |
| 22 | | import com.google.common.collect.Iterables; |
| 23 | | import com.google.common.collect.Lists; |
| 24 | | import com.google.common.collect.ImmutableList; |
| 25 | | import static com.google.common.collect.Lists.*; |
| 26 | | import com.google.common.base.Function; |
| 27 | | import com.google.common.base.Nullable; |
| 28 | 22 | |
| 29 | 23 | import java.util.Collection; |
-
|
r90
|
r108
|
|
| 17 | 17 | |
| 18 | 18 | import com.thimbleware.jrel.QueryVisitor; |
| | 19 | import com.thimbleware.jrel.expr.AbstractExpression; |
| 19 | 20 | import com.thimbleware.jrel.expr.Expression; |
| 20 | 21 | import com.thimbleware.jrel.expr.ExpressionVisitor; |
| 21 | | import com.thimbleware.jrel.expr.AbstractExpression; |
| 22 | 22 | |
| 23 | 23 | /** |
-
|
r98
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr.operators; |
| 17 | 17 | |
| | 18 | import com.thimbleware.jrel.QueryVisitor; |
| 18 | 19 | import com.thimbleware.jrel.expr.Expression; |
| 19 | | import com.thimbleware.jrel.QueryVisitor; |
| 20 | 20 | |
| 21 | 21 | /** |
-
|
r90
|
r108
|
|
| 19 | 19 | import com.thimbleware.jrel.expr.Expression; |
| 20 | 20 | import com.thimbleware.jrel.expr.ExpressionVisitor; |
| 21 | | import com.thimbleware.jrel.expr.operators.BinaryOperator; |
| 22 | 21 | |
| 23 | 22 | /** |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.expr.operators; |
| 17 | 17 | |
| | 18 | import com.google.common.base.Function; |
| | 19 | import com.google.common.collect.ImmutableList; |
| | 20 | import com.google.common.collect.Iterables; |
| 18 | 21 | import com.thimbleware.jrel.exceptions.UnsupportedTypeException; |
| 19 | 22 | import com.thimbleware.jrel.expr.*; |
| … |
… |
|
| 21 | 24 | import com.thimbleware.jrel.expr.literals.*; |
| 22 | 25 | import com.thimbleware.jrel.util.Matcher; |
| 23 | | import com.google.common.collect.Iterables; |
| 24 | | import com.google.common.collect.ImmutableList; |
| 25 | | import com.google.common.base.Function; |
| 26 | | import com.google.common.base.Nullable; |
| 27 | 26 | |
| 28 | 27 | import java.util.Date; |
| … |
… |
|
| 145 | 144 | public static <T> Iterable<Expression> exprArr(T[] value) { |
| 146 | 145 | return Iterables.transform(ImmutableList.of(value), new Function<T, Expression>() { |
| 147 | | public Expression apply(@Nullable T t) { |
| | 146 | public Expression apply(T t) { |
| 148 | 147 | return expr(t); |
| 149 | 148 | } |
-
|
r90
|
r108
|
|
| 17 | 17 | |
| 18 | 18 | import com.thimbleware.jrel.QueryVisitor; |
| | 19 | import com.thimbleware.jrel.expr.AbstractExpression; |
| 19 | 20 | import com.thimbleware.jrel.expr.Expression; |
| 20 | 21 | import com.thimbleware.jrel.expr.ExpressionVisitor; |
| 21 | | import com.thimbleware.jrel.expr.AbstractExpression; |
| 22 | 22 | |
| 23 | 23 | /** |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.schema; |
| 17 | 17 | |
| | 18 | import com.thimbleware.jrel.exceptions.NoSuchAttributeException; |
| 18 | 19 | import com.thimbleware.jrel.expr.attributes.Attribute; |
| 19 | 20 | import com.thimbleware.jrel.expr.attributes.NamedAttribute; |
| 20 | | import com.thimbleware.jrel.exceptions.NoSuchAttributeException; |
| 21 | 21 | |
| 22 | 22 | /** |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.schema; |
| 17 | 17 | |
| | 18 | import com.google.common.collect.ImmutableList; |
| | 19 | import static com.google.common.collect.Iterables.concat; |
| 18 | 20 | import com.thimbleware.jrel.QueryVisitor; |
| 19 | | import com.google.common.collect.ImmutableList; |
| 20 | | import static com.google.common.collect.Iterables.*; |
| 21 | 21 | |
| 22 | 22 | import java.util.ArrayList; |
-
|
r95
|
r108
|
|
| 17 | 17 | |
| 18 | 18 | import com.google.common.base.Function; |
| 19 | | import com.google.common.base.Nullable; |
| 20 | 19 | import com.google.common.base.Predicate; |
| 21 | 20 | import com.google.common.collect.ImmutableList; |
| | 21 | import com.google.common.collect.Iterables; |
| 22 | 22 | import static com.google.common.collect.Iterables.*; |
| | 23 | import static com.google.common.collect.Iterables.toArray; |
| 23 | 24 | import com.thimbleware.jrel.exceptions.NoSuchAttributeException; |
| 24 | 25 | import com.thimbleware.jrel.expr.attributes.Attribute; |
| … |
… |
|
| 26 | 27 | import com.thimbleware.jrel.expr.attributes.TableAttribute; |
| 27 | 28 | import static com.thimbleware.jrel.util.Functional.exists; |
| | 29 | |
| 28 | 30 | import java.util.NoSuchElementException; |
| 29 | 31 | |
| … |
… |
|
| 61 | 63 | transform(domains, |
| 62 | 64 | new Function<TableDomain, Iterable<TableAttribute>>() { |
| 63 | | public Iterable<TableAttribute> apply(@Nullable TableDomain domain) { |
| | 65 | public Iterable<TableAttribute> apply(TableDomain domain) { |
| 64 | 66 | return domain.getAttributes(); |
| 65 | 67 | } |
| … |
… |
|
| 82 | 84 | public TableDomain addAttribute(Class<?> type, String name) { |
| 83 | 85 | Iterable<TableAttribute> added = ImmutableList.of(new TableAttribute(relation, name, type)); |
| 84 | | return new TableDomain(relation, newArray(concat(attributes, added), TableAttribute.class)); |
| | 86 | return new TableDomain(relation, toArray(concat(attributes, added), TableAttribute.class)); |
| 85 | 87 | } |
| 86 | 88 | |
| … |
… |
|
| 91 | 93 | */ |
| 92 | 94 | public TableDomain changeTable(final Table newTable) { |
| 93 | | return new TableDomain(relation, newArray(transform(this.attributes, new Function<TableAttribute, TableAttribute>() { |
| 94 | | public TableAttribute apply(@Nullable TableAttribute relationAttribute) { |
| | 95 | return new TableDomain(relation, toArray(transform(this.attributes, new Function<TableAttribute, TableAttribute>() { |
| | 96 | public TableAttribute apply(TableAttribute relationAttribute) { |
| 95 | 97 | return new TableAttribute(newTable, relationAttribute.getName(), relationAttribute.getType()); |
| 96 | 98 | } |
| … |
… |
|
| 111 | 113 | return |
| 112 | 114 | exists(attributes, new Predicate<TableAttribute>() { |
| 113 | | public boolean apply(@Nullable TableAttribute relationAttribute) { |
| | 115 | public boolean apply(TableAttribute relationAttribute) { |
| 114 | 116 | return attr.equals(relationAttribute); |
| 115 | 117 | } |
| … |
… |
|
| 125 | 127 | try { |
| 126 | 128 | return find(attributes, new Predicate<RelationAttribute>() { |
| 127 | | public boolean apply(@Nullable RelationAttribute attr) { |
| | 129 | public boolean apply(RelationAttribute attr) { |
| 128 | 130 | return attr.getName().toLowerCase().equals(attributeName.toLowerCase()); |
| 129 | 131 | } |
| … |
… |
|
| 141 | 143 | try { |
| 142 | 144 | return find(attributes, new Predicate<Attribute>() { |
| 143 | | public boolean apply(@Nullable Attribute attr) { |
| | 145 | public boolean apply(Attribute attr) { |
| 144 | 146 | return attr.equals(attribute); |
| 145 | 147 | } |
| … |
… |
|
| 156 | 158 | try { |
| 157 | 159 | find(attributes, new Predicate<RelationAttribute>() { |
| 158 | | public boolean apply(@Nullable RelationAttribute attr) { |
| | 160 | public boolean apply(RelationAttribute attr) { |
| 159 | 161 | return attributeName.toLowerCase().equals(attr.getName().toLowerCase()); |
| 160 | 162 | } |
-
|
r90
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.schema; |
| 17 | 17 | |
| 18 | | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 19 | | import com.thimbleware.jrel.expr.attributes.Attribute; |
| 20 | | import static com.thimbleware.jrel.util.Functional.exists; |
| 21 | | import com.thimbleware.jrel.exceptions.NoSuchAttributeException; |
| | 18 | import com.google.common.base.Function; |
| | 19 | import com.google.common.base.Predicate; |
| 22 | 20 | import com.google.common.collect.ImmutableList; |
| 23 | 21 | import static com.google.common.collect.Iterables.*; |
| 24 | | import static com.google.common.collect.Iterables.transform; |
| 25 | | import com.google.common.base.Function; |
| 26 | | import com.google.common.base.Nullable; |
| 27 | | import com.google.common.base.Predicate; |
| | 22 | import com.thimbleware.jrel.exceptions.NoSuchAttributeException; |
| | 23 | import com.thimbleware.jrel.expr.attributes.Attribute; |
| | 24 | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| | 25 | import static com.thimbleware.jrel.util.Functional.exists; |
| | 26 | |
| 28 | 27 | import java.util.NoSuchElementException; |
| 29 | 28 | |
| … |
… |
|
| 54 | 53 | transform(domains, |
| 55 | 54 | new Function<TableDomain, Iterable<RelationAttribute>>() { |
| 56 | | public Iterable<RelationAttribute> apply(@Nullable TableDomain domain) { |
| | 55 | public Iterable<RelationAttribute> apply(TableDomain domain) { |
| 57 | 56 | return ImmutableList.<RelationAttribute>copyOf(domain.getAttributes()); |
| 58 | 57 | } |
| … |
… |
|
| 74 | 73 | return |
| 75 | 74 | exists(attributes, new Predicate<RelationAttribute>() { |
| 76 | | public boolean apply(@Nullable RelationAttribute relationAttribute) { |
| | 75 | public boolean apply(RelationAttribute relationAttribute) { |
| 77 | 76 | return relationAttribute.equals(attr); |
| 78 | 77 | } |
| … |
… |
|
| 88 | 87 | try { |
| 89 | 88 | return find(attributes, new Predicate<RelationAttribute>() { |
| 90 | | public boolean apply(@Nullable RelationAttribute attr) { |
| | 89 | public boolean apply(RelationAttribute attr) { |
| 91 | 90 | return attr.getName().toLowerCase().equals(attributeName.toLowerCase()); |
| 92 | 91 | } |
| … |
… |
|
| 104 | 103 | try { |
| 105 | 104 | return find(attributes, new Predicate<Attribute>() { |
| 106 | | public boolean apply(@Nullable Attribute attr) { |
| | 105 | public boolean apply(Attribute attr) { |
| 107 | 106 | return attr.equals(attribute); |
| 108 | 107 | } |
| … |
… |
|
| 120 | 119 | try { |
| 121 | 120 | find(attributes, new Predicate<RelationAttribute>() { |
| 122 | | public boolean apply(@Nullable RelationAttribute attr) { |
| | 121 | public boolean apply(RelationAttribute attr) { |
| 123 | 122 | return attributeName.toLowerCase().equals(attr.getName().toLowerCase()); |
| 124 | 123 | } |
-
|
r106
|
r108
|
|
| 17 | 17 | |
| 18 | 18 | import com.google.common.collect.ImmutableMap; |
| | 19 | import com.thimbleware.jrel.exceptions.NoSuchAttributeException; |
| | 20 | import com.thimbleware.jrel.expr.Expression; |
| 19 | 21 | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 20 | | import com.thimbleware.jrel.expr.Expression; |
| 21 | | import static com.thimbleware.jrel.expr.operators.Op.*; |
| 22 | | import com.thimbleware.jrel.exceptions.NoSuchAttributeException; |
| | 22 | import static com.thimbleware.jrel.expr.operators.Op.expr; |
| 23 | 23 | |
| | 24 | import java.util.LinkedHashMap; |
| 24 | 25 | import java.util.Map; |
| 25 | | import java.util.LinkedHashMap; |
| 26 | 26 | |
| 27 | 27 | /** |
-
|
r105
|
r108
|
|
| 17 | 17 | |
| 18 | 18 | import com.google.common.base.Function; |
| 19 | | import static com.google.common.base.Join.join; |
| 20 | | import com.google.common.base.Nullable; |
| 21 | | import com.google.common.base.Join; |
| | 19 | import com.google.common.base.Joiner; |
| 22 | 20 | import com.google.common.collect.HashMultimap; |
| 23 | 21 | import com.google.common.collect.ImmutableList; |
| 24 | 22 | import static com.google.common.collect.Iterables.reverse; |
| 25 | 23 | import static com.google.common.collect.Iterables.transform; |
| | 24 | import com.google.common.collect.LinkedHashMultimap; |
| 26 | 25 | import static com.google.common.collect.Lists.newLinkedList; |
| 27 | 26 | import com.google.common.collect.Multimap; |
| 28 | | import com.google.common.collect.LinkedHashMultimap; |
| | 27 | import com.sun.istack.internal.Nullable; |
| 29 | 28 | import com.thimbleware.jrel.*; |
| 30 | 29 | import com.thimbleware.jrel.exceptions.CannotUseFunctionProjectionInReferenceException; |
| … |
… |
|
| 32 | 31 | import com.thimbleware.jrel.exceptions.UnsupportedTypeException; |
| 33 | 32 | import com.thimbleware.jrel.expr.*; |
| 34 | | import com.thimbleware.jrel.expr.attributes.TableAttribute; |
| 35 | | import com.thimbleware.jrel.expr.attributes.WildcardAttribute; |
| 36 | | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 37 | | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| 38 | | import com.thimbleware.jrel.expr.attributes.Attribute; |
| 39 | | import com.thimbleware.jrel.expr.attributes.AliasedAttribute; |
| 40 | | import com.thimbleware.jrel.expr.literals.LongLiteral; |
| | 33 | import com.thimbleware.jrel.expr.attributes.*; |
| 41 | 34 | import com.thimbleware.jrel.expr.literals.ParameterLiteral; |
| 42 | 35 | import com.thimbleware.jrel.expr.literals.TupleLiteral; |
| 43 | 36 | import com.thimbleware.jrel.expr.operators.BinaryOperator; |
| | 37 | import com.thimbleware.jrel.expr.operators.CastOperator; |
| 44 | 38 | import com.thimbleware.jrel.expr.operators.Condition; |
| 45 | 39 | import com.thimbleware.jrel.expr.operators.UnaryOperator; |
| 46 | | import com.thimbleware.jrel.expr.operators.CastOperator; |
| 47 | 40 | import com.thimbleware.jrel.schema.*; |
| 48 | 41 | import com.thimbleware.jrel.util.DirectedGraph; |
| … |
… |
|
| 62 | 55 | |
| 63 | 56 | public String selectStatement(SQLVisitor visitor, boolean distinctProjection, Collection<Attribute> attributes) { |
| 64 | | return "SELECT " + (distinctProjection ? "DISTINCT " : "") + join(", ", attributes(visitor, attributes)); |
| | 57 | return "SELECT " + (distinctProjection ? "DISTINCT " : "") + Joiner.on(", ").join(attributes(visitor, attributes)); |
| 65 | 58 | } |
| 66 | 59 | |
| … |
… |
|
| 117 | 110 | public String functionApplication(final SQLVisitor visitor, FunctionApplication function) { |
| 118 | 111 | return function.getFunctionName() + "(" + |
| 119 | | Join.join(", ", transform(function.getArguments(), new Function<Expression, String>() { |
| | 112 | Joiner.on(", ").join( transform(function.getArguments(), new Function<Expression, String>() { |
| 120 | 113 | public String apply(@Nullable Expression expression) { |
| 121 | 114 | return expression.visit(visitor); |
| … |
… |
|
| 135 | 128 | if (joins.size() != 0) { |
| 136 | 129 | // |
| 137 | | Multimap<NamedRelation, JoinClause> joinEdges = new LinkedHashMultimap<NamedRelation, JoinClause>(); |
| | 130 | Multimap<NamedRelation, JoinClause> joinEdges = LinkedHashMultimap.create(); |
| 138 | 131 | HashSet<JoinClause> visited = new HashSet<JoinClause>(); |
| 139 | 132 | |
| … |
… |
|
| 160 | 153 | |
| 161 | 154 | // for each join type... |
| 162 | | Multimap<JoinType, JoinClause> edgesByType = new HashMultimap<JoinType, JoinClause>(); |
| | 155 | Multimap<JoinType, JoinClause> edgesByType = HashMultimap.create(); |
| 163 | 156 | for (JoinClause edge : edges) { |
| 164 | 157 | edgesByType.put(edge.type, edge); |
| … |
… |
|
| 179 | 172 | break; |
| 180 | 173 | } |
| 181 | | buffer.append(" JOIN ").append(namedRelation.visit(visitor) + " ON " + join(" AND ", transform(joinEdgesByType, new Function<JoinClause, String>() { |
| | 174 | buffer.append(" JOIN ").append(namedRelation.visit(visitor) + " ON " + Joiner.on(" AND ").join(transform(joinEdgesByType, new Function<JoinClause, String>() { |
| 182 | 175 | public String apply(@Nullable JoinClause joinEdge) { |
| 183 | | return join(" AND ", transform(joinEdge.conditions, new Function<Condition, String>() { |
| | 176 | return Joiner.on(" AND ").join(transform(joinEdge.conditions, new Function<Condition, String>() { |
| 184 | 177 | public String apply(@Nullable Condition condition) { |
| 185 | 178 | return condition.visit(visitor); |
| … |
… |
|
| 206 | 199 | if (restrictions.size() == 0) return ""; |
| 207 | 200 | else |
| 208 | | return " WHERE " + join(" AND ", transform(restrictions, new Function<Expression, String>() { |
| | 201 | return " WHERE " + Joiner.on(" AND ").join(transform(restrictions, new Function<Expression, String>() { |
| 209 | 202 | public String apply(Expression x) { |
| 210 | 203 | return x.visit(visitor); |
| … |
… |
|
| 216 | 209 | if (groupBy.size() == 0) return ""; |
| 217 | 210 | else |
| 218 | | return " GROUP BY " + join(", ", transform(groupBy, new Function<Attribute, String>() { |
| | 211 | return " GROUP BY " + Joiner.on(", ").join(transform(groupBy, new Function<Attribute, String>() { |
| 219 | 212 | public String apply(Attribute x) { |
| 220 | 213 | return x.visit(visitor); |
| … |
… |
|
| 226 | 219 | if (orderBy.size() == 0) return ""; |
| 227 | 220 | else |
| 228 | | return " ORDER BY " + join(", ", transform(orderBy, new Function<Attribute, String>() { |
| | 221 | return " ORDER BY " + Joiner.on(", ").join(transform(orderBy, new Function<Attribute, String>() { |
| 229 | 222 | public String apply(Attribute x) { |
| 230 | 223 | return x.visit(visitor); |
| … |
… |
|
| 251 | 244 | |
| 252 | 245 | private String relationSpecs(final SQLVisitor visitor, Collection<Relation> relations) { |
| 253 | | return join(", ", |
| 254 | | transform(relations, new Function<Relation, String>() { |
| | 246 | return Joiner.on(", ").join(transform(relations, new Function<Relation, String>() { |
| 255 | 247 | public String apply(Relation x) { |
| 256 | 248 | return x.visit(visitor); |
| … |
… |
|
| 292 | 284 | public <T> String literal(final SQLVisitor visitor, TupleLiteral<T> tupleLiteral) { |
| 293 | 285 | // TODO reify types, make this use pattern matching, or something to reduce code maintenance nightmare |
| 294 | | return "(" + join(", ", transform(tupleLiteral.getValue(), new Function<T, String>() { |
| | 286 | return "(" + Joiner.on(", ").join(transform(tupleLiteral.getValue(), new Function<T, String>() { |
| 295 | 287 | public String apply(@Nullable T value) { |
| 296 | 288 | if (value instanceof String) |
| … |
… |
|
| 371 | 363 | public String updateStatement(final SQLVisitor sqlVisitor, Update update) { |
| 372 | 364 | StringBuilder updateStatement = new StringBuilder("UPDATE " + update.getRelation().visit(sqlVisitor) + " SET "); |
| 373 | | updateStatement.append(join(", ", transform(update.getAssignments(), new Function<Assignment, String>(){ |
| | 365 | updateStatement.append(Joiner.on(", ").join(transform(update.getAssignments(), new Function<Assignment, String>(){ |
| 374 | 366 | public String apply(@Nullable Assignment assignment) { |
| 375 | 367 | return assignment.getAttribute().getName() + " = " + assignment.getValue().visit(sqlVisitor); |
| … |
… |
|
| 383 | 375 | }); |
| 384 | 376 | if (!ImmutableList.copyOf(restrictions).isEmpty()) |
| 385 | | updateStatement.append(" WHERE ").append(join(" AND ", restrictions)); |
| | 377 | updateStatement.append(" WHERE ").append(Joiner.on(" AND ").join(restrictions)); |
| 386 | 378 | |
| 387 | 379 | return updateStatement.toString(); |
| … |
… |
|
| 390 | 382 | public String insertStatement(final SQLVisitor sqlVisitor, final Insert insert) { |
| 391 | 383 | StringBuilder insertStatement = new StringBuilder("INSERT INTO " + insert.getRelation().getTableName()); |
| 392 | | insertStatement.append(" (").append(join(", ", transform(insert.getValues().getDomain().getAttributes(), new Function<RelationAttribute, String>() { |
| | 384 | insertStatement.append(" (").append(Joiner.on(", ").join(transform(insert.getValues().getDomain().getAttributes(), new Function<RelationAttribute, String>() { |
| 393 | 385 | public String apply(@Nullable RelationAttribute relationAttribute) { |
| 394 | 386 | return relationAttribute.getName(); |
| 395 | 387 | } |
| 396 | 388 | }))).append(") VALUES "); |
| 397 | | insertStatement.append( join(", ", transform(insert.getValues().getRange(), new Function<TupleVar, String>() { |
| | 389 | insertStatement.append( Joiner.on(", ").join(transform(insert.getValues().getRange(), new Function<TupleVar, String>() { |
| 398 | 390 | public String apply(@Nullable final TupleVar tupleVar) { |
| 399 | | return "( " + join(", ", transform(insert.getValues().getDomain().getAttributes(), new Function<RelationAttribute, String>() { |
| | 391 | return "( " + Joiner.on(", ").join(transform(insert.getValues().getDomain().getAttributes(), new Function<RelationAttribute, String>() { |
| 400 | 392 | public String apply(@Nullable RelationAttribute relationAttribute) { |
| 401 | 393 | return tupleVar.get(relationAttribute.getName()).visit(sqlVisitor); |
| … |
… |
|
| 418 | 410 | }); |
| 419 | 411 | if (!ImmutableList.copyOf(restrictions).isEmpty()) |
| 420 | | updateStatement.append(" WHERE ").append(join(" AND ", restrictions)); |
| | 412 | updateStatement.append(" WHERE ").append(Joiner.on(" AND ").join(restrictions)); |
| 421 | 413 | |
| 422 | 414 | return updateStatement.toString(); |
| … |
… |
|
| 428 | 420 | |
| 429 | 421 | public String caseStatement(final SQLVisitor visitor, ConditionalExpression conditionalExpression) { |
| 430 | | return "CASE WHEN " + Join.join(" WHEN ", transform(conditionalExpression.getConditions(), new Function<Pair<Condition, Expression>, String>() { |
| | 422 | return "CASE WHEN " + Joiner.on(" WHEN ").join(transform(conditionalExpression.getConditions(), new Function<Pair<Condition, Expression>, String>() { |
| 431 | 423 | public String apply(@Nullable Pair<Condition, Expression> conditionExpressionEntry) { |
| 432 | 424 | return conditionExpressionEntry.left.visit(visitor) + " THEN " + conditionExpressionEntry.right.visit(visitor); |
-
|
r95
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.sql; |
| 17 | 17 | |
| | 18 | import com.thimbleware.jrel.Delete; |
| | 19 | import com.thimbleware.jrel.Insert; |
| 18 | 20 | import com.thimbleware.jrel.JoinClause; |
| 19 | 21 | import com.thimbleware.jrel.Update; |
| 20 | | import com.thimbleware.jrel.Insert; |
| 21 | | import com.thimbleware.jrel.Delete; |
| 22 | 22 | import com.thimbleware.jrel.expr.*; |
| 23 | | import com.thimbleware.jrel.expr.attributes.TableAttribute; |
| 24 | | import com.thimbleware.jrel.expr.attributes.WildcardAttribute; |
| 25 | | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 26 | | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| 27 | | import com.thimbleware.jrel.expr.attributes.Attribute; |
| 28 | | import com.thimbleware.jrel.expr.attributes.AliasedAttribute; |
| | 23 | import com.thimbleware.jrel.expr.attributes.*; |
| | 24 | import com.thimbleware.jrel.expr.literals.ParameterLiteral; |
| | 25 | import com.thimbleware.jrel.expr.literals.TupleLiteral; |
| | 26 | import com.thimbleware.jrel.expr.operators.BinaryOperator; |
| | 27 | import com.thimbleware.jrel.expr.operators.CastOperator; |
| 29 | 28 | import com.thimbleware.jrel.expr.operators.Condition; |
| 30 | | import com.thimbleware.jrel.expr.operators.BinaryOperator; |
| 31 | 29 | import com.thimbleware.jrel.expr.operators.UnaryOperator; |
| 32 | | import com.thimbleware.jrel.expr.operators.CastOperator; |
| 33 | | import com.thimbleware.jrel.expr.literals.TupleLiteral; |
| 34 | | import com.thimbleware.jrel.expr.literals.ParameterLiteral; |
| | 30 | import com.thimbleware.jrel.schema.NamedRelation; |
| 35 | 31 | import com.thimbleware.jrel.schema.Relation; |
| | 32 | import com.thimbleware.jrel.schema.Subselect; |
| 36 | 33 | import com.thimbleware.jrel.schema.Table; |
| 37 | | import com.thimbleware.jrel.schema.Subselect; |
| 38 | | import com.thimbleware.jrel.schema.NamedRelation; |
| 39 | | |
| | 34 | |
| | 35 | import java.sql.Connection; |
| | 36 | import java.sql.SQLException; |
| | 37 | import java.util.ArrayList; |
| 40 | 38 | import java.util.Collection; |
| 41 | | import java.util.ArrayList; |
| 42 | 39 | import java.util.Date; |
| 43 | 40 | import java.util.Map; |
| 44 | | import java.sql.Connection; |
| 45 | | import java.sql.SQLException; |
| 46 | 41 | |
| 47 | 42 | /** |
-
|
r88
|
r108
|
|
| 18 | 18 | import com.thimbleware.jrel.*; |
| 19 | 19 | import com.thimbleware.jrel.exceptions.OperationNotSupportedException; |
| | 20 | import com.thimbleware.jrel.expr.*; |
| | 21 | import com.thimbleware.jrel.expr.attributes.*; |
| | 22 | import com.thimbleware.jrel.expr.literals.*; |
| | 23 | import com.thimbleware.jrel.expr.operators.*; |
| | 24 | import com.thimbleware.jrel.schema.RelVar; |
| | 25 | import com.thimbleware.jrel.schema.Subselect; |
| 20 | 26 | import com.thimbleware.jrel.schema.Table; |
| 21 | | import com.thimbleware.jrel.schema.Subselect; |
| 22 | | import com.thimbleware.jrel.schema.RelVar; |
| 23 | | import com.thimbleware.jrel.expr.*; |
| 24 | | import com.thimbleware.jrel.expr.attributes.TableAttribute; |
| 25 | | import com.thimbleware.jrel.expr.attributes.WildcardAttribute; |
| 26 | | import com.thimbleware.jrel.expr.attributes.RelationAttribute; |
| 27 | | import com.thimbleware.jrel.expr.attributes.ExpressionAttribute; |
| 28 | | import com.thimbleware.jrel.expr.attributes.AliasedAttribute; |
| 29 | | import com.thimbleware.jrel.expr.operators.Condition; |
| 30 | | import com.thimbleware.jrel.expr.operators.BinaryOperator; |
| 31 | | import com.thimbleware.jrel.expr.operators.UnaryOperator; |
| 32 | | import com.thimbleware.jrel.expr.operators.Op; |
| 33 | | import com.thimbleware.jrel.expr.operators.CastOperator; |
| 34 | | import com.thimbleware.jrel.expr.literals.*; |
| 35 | 27 | |
| | 28 | import java.util.HashMap; |
| 36 | 29 | import java.util.Map; |
| 37 | | import java.util.HashMap; |
| 38 | 30 | |
| 39 | 31 | /** |
-
|
r107
|
r108
|
|
| 21 | 21 | import com.thimbleware.jrel.sql.AbstractANSISQLDialect; |
| 22 | 22 | import com.thimbleware.jrel.util.Matcher; |
| | 23 | |
| 23 | 24 | import static java.sql.Types.*; |
| 24 | 25 | import java.text.SimpleDateFormat; |
-
|
r95
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.sql.dialect; |
| 17 | 17 | |
| | 18 | import com.google.common.collect.ImmutableList; |
| | 19 | import com.thimbleware.jrel.Insert; |
| | 20 | import com.thimbleware.jrel.exceptions.OperationNotSupportedException; |
| 18 | 21 | import com.thimbleware.jrel.exceptions.UnsupportedTypeException; |
| 19 | | import com.thimbleware.jrel.exceptions.OperationNotSupportedException; |
| 20 | 22 | import com.thimbleware.jrel.sql.AbstractANSISQLDialect; |
| 21 | 23 | import com.thimbleware.jrel.sql.SQLVisitor; |
| 22 | 24 | import com.thimbleware.jrel.util.Matcher; |
| 23 | | import com.thimbleware.jrel.Insert; |
| 24 | | import com.google.common.collect.ImmutableList; |
| 25 | 25 | |
| 26 | | import java.util.Date; |
| 27 | 26 | import static java.sql.Types.*; |
| 28 | 27 | import java.text.SimpleDateFormat; |
| | 28 | import java.util.Date; |
| 29 | 29 | |
| 30 | 30 | /** |
-
|
r95
|
r108
|
|
| 20 | 20 | import com.thimbleware.jrel.util.Matcher; |
| 21 | 21 | |
| 22 | | import java.util.Date; |
| 23 | 22 | import static java.sql.Types.*; |
| 24 | 23 | import java.text.SimpleDateFormat; |
| | 24 | import java.util.Date; |
| 25 | 25 | |
| 26 | 26 | /** |
-
|
r107
|
r108
|
|
| 21 | 21 | import com.thimbleware.jrel.sql.AbstractANSISQLDialect; |
| 22 | 22 | import com.thimbleware.jrel.util.Matcher; |
| | 23 | |
| 23 | 24 | import static java.sql.Types.*; |
| 24 | 25 | import java.text.SimpleDateFormat; |
-
|
r56
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.sql.introspection; |
| 17 | 17 | |
| 18 | | import java.lang.annotation.Target; |
| | 18 | import static java.lang.annotation.ElementType.FIELD; |
| | 19 | import static java.lang.annotation.ElementType.METHOD; |
| 19 | 20 | import java.lang.annotation.Retention; |
| 20 | 21 | import static java.lang.annotation.RetentionPolicy.RUNTIME; |
| 21 | | import static java.lang.annotation.ElementType.METHOD; |
| 22 | | import static java.lang.annotation.ElementType.FIELD; |
| | 22 | import java.lang.annotation.Target; |
| 23 | 23 | |
| 24 | 24 | @Target({METHOD, FIELD}) |
-
|
r84
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.sql.introspection; |
| 17 | 17 | |
| | 18 | import com.thimbleware.jrel.exceptions.DBIntrospectionException; |
| | 19 | import com.thimbleware.jrel.schema.Table; |
| 18 | 20 | import com.thimbleware.jrel.sql.SQLDialect; |
| 19 | 21 | import com.thimbleware.jrel.sql.SQLVisitor; |
| 20 | | import com.thimbleware.jrel.schema.Table; |
| 21 | 22 | import com.thimbleware.jrel.util.Cache; |
| 22 | | import com.thimbleware.jrel.exceptions.DBIntrospectionException; |
| 23 | 23 | |
| 24 | 24 | import javax.sql.DataSource; |
| 25 | | import java.util.ArrayList; |
| 26 | 25 | import java.sql.Connection; |
| 27 | 26 | import java.sql.SQLException; |
| | 27 | import java.util.ArrayList; |
| 28 | 28 | |
| 29 | 29 | /** |
-
|
r90
|
r108
|
|
| 18 | 18 | |
| 19 | 19 | import com.thimbleware.jrel.schema.Table; |
| 20 | | import com.thimbleware.jrel.sql.introspection.DB; |
| 21 | 20 | |
| 22 | 21 | import javax.annotation.PostConstruct; |
-
|
r94
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.sql.introspection; |
| 17 | 17 | |
| | 18 | import java.lang.annotation.ElementType; |
| 18 | 19 | import java.lang.annotation.Retention; |
| | 20 | import java.lang.annotation.RetentionPolicy; |
| 19 | 21 | import java.lang.annotation.Target; |
| 20 | | import java.lang.annotation.ElementType; |
| 21 | | import java.lang.annotation.RetentionPolicy; |
| 22 | 22 | |
| 23 | 23 | @Target({ElementType.TYPE}) |
-
|
r84
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.util; |
| 17 | 17 | |
| 18 | | import com.google.common.base.Function; |
| 19 | 18 | import com.google.common.base.Predicate; |
| 20 | | import com.google.common.collect.Iterables; |
| | 19 | |
| 21 | 20 | import java.util.NoSuchElementException; |
| 22 | 21 | |
-
|
r64
|
r108
|
|
| 16 | 16 | package com.thimbleware.jrel.util; |
| 17 | 17 | |
| 18 | | import com.google.common.base.Function; |
| 19 | | |
| 20 | | import java.util.Map; |
| 21 | 18 | import java.util.ArrayList; |
| 22 | 19 | import java.util.HashMap; |
| | 20 | import java.util.Map; |
| 23 | 21 | |
| 24 | 22 | /** |