Skip to content

Commit

Permalink
ignite-sql-old - annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
S.Vladykin committed Feb 13, 2015
1 parent 6f2dc26 commit 8be3faa
Show file tree
Hide file tree
Showing 45 changed files with 499 additions and 208 deletions.
Expand Up @@ -21,6 +21,7 @@
import org.apache.ignite.cache.*; import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*; import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.query.*; import org.apache.ignite.cache.query.*;
import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.lang.*; import org.apache.ignite.lang.*;


import java.io.*; import java.io.*;
Expand Down Expand Up @@ -374,27 +375,27 @@ private static void print(Object o) {
*/ */
private static class Person implements Serializable { private static class Person implements Serializable {
/** Person ID (indexed). */ /** Person ID (indexed). */
@CacheQuerySqlField(index = true) @QuerySqlField(index = true)
private UUID id; private UUID id;


/** Organization ID (indexed). */ /** Organization ID (indexed). */
@CacheQuerySqlField(index = true) @QuerySqlField(index = true)
private UUID orgId; private UUID orgId;


/** First name (not-indexed). */ /** First name (not-indexed). */
@CacheQuerySqlField @QuerySqlField
private String firstName; private String firstName;


/** Last name (not indexed). */ /** Last name (not indexed). */
@CacheQuerySqlField @QuerySqlField
private String lastName; private String lastName;


/** Resume text (create LUCENE-based TEXT index for this field). */ /** Resume text (create LUCENE-based TEXT index for this field). */
@CacheQueryTextField @QueryTextField
private String resume; private String resume;


/** Salary (indexed). */ /** Salary (indexed). */
@CacheQuerySqlField @QuerySqlField
private double salary; private double salary;


/** Custom cache key to guarantee that person is always collocated with its organization. */ /** Custom cache key to guarantee that person is always collocated with its organization. */
Expand Down Expand Up @@ -450,11 +451,11 @@ public CacheAffinityKey<UUID> key() {
*/ */
private static class Organization implements Serializable { private static class Organization implements Serializable {
/** Organization ID (indexed). */ /** Organization ID (indexed). */
@CacheQuerySqlField(index = true) @QuerySqlField(index = true)
private UUID id; private UUID id;


/** Organization name (indexed). */ /** Organization name (indexed). */
@CacheQuerySqlField(index = true) @QuerySqlField(index = true)
private String name; private String name;


/** /**
Expand Down
Expand Up @@ -17,8 +17,8 @@


package org.apache.ignite.examples.datagrid.starschema; package org.apache.ignite.examples.datagrid.starschema;


import org.apache.ignite.cache.query.*;
import org.apache.ignite.cache.*; import org.apache.ignite.cache.*;
import org.apache.ignite.cache.query.annotations.*;


/** /**
* Represents a product available for purchase. In our {@code snowflake} schema a {@code product} * Represents a product available for purchase. In our {@code snowflake} schema a {@code product}
Expand All @@ -27,14 +27,14 @@
*/ */
public class DimProduct { public class DimProduct {
/** Primary key. */ /** Primary key. */
@CacheQuerySqlField(index = true) @QuerySqlField(index = true)
private int id; private int id;


/** Product name. */ /** Product name. */
private String name; private String name;


/** Product list price. */ /** Product list price. */
@CacheQuerySqlField @QuerySqlField
private float price; private float price;


/** Available product quantity. */ /** Available product quantity. */
Expand Down
Expand Up @@ -17,8 +17,8 @@


package org.apache.ignite.examples.datagrid.starschema; package org.apache.ignite.examples.datagrid.starschema;


import org.apache.ignite.cache.query.*;
import org.apache.ignite.cache.*; import org.apache.ignite.cache.*;
import org.apache.ignite.cache.query.annotations.*;


/** /**
* Represents a physical store location. In our {@code snowflake} schema a {@code store} * Represents a physical store location. In our {@code snowflake} schema a {@code store}
Expand All @@ -27,11 +27,11 @@
*/ */
public class DimStore { public class DimStore {
/** Primary key. */ /** Primary key. */
@CacheQuerySqlField(index = true) @QuerySqlField(index = true)
private int id; private int id;


/** Store name. */ /** Store name. */
@CacheQuerySqlField @QuerySqlField
private String name; private String name;


/** Zip code. */ /** Zip code. */
Expand Down
Expand Up @@ -17,8 +17,8 @@


package org.apache.ignite.examples.datagrid.starschema; package org.apache.ignite.examples.datagrid.starschema;


import org.apache.ignite.cache.query.*;
import org.apache.ignite.cache.*; import org.apache.ignite.cache.*;
import org.apache.ignite.cache.query.annotations.*;


/** /**
* Represents a purchase record. In our {@code snowflake} schema purchase * Represents a purchase record. In our {@code snowflake} schema purchase
Expand All @@ -27,19 +27,19 @@
*/ */
public class FactPurchase { public class FactPurchase {
/** Primary key. */ /** Primary key. */
@CacheQuerySqlField(index = true) @QuerySqlField(index = true)
private int id; private int id;


/** Foreign key to store at which purchase occurred. */ /** Foreign key to store at which purchase occurred. */
@CacheQuerySqlField @QuerySqlField
private int storeId; private int storeId;


/** Foreign key to purchased product. */ /** Foreign key to purchased product. */
@CacheQuerySqlField @QuerySqlField
private int productId; private int productId;


/** Purchase price. */ /** Purchase price. */
@CacheQuerySqlField @QuerySqlField
private float purchasePrice; private float purchasePrice;


/** /**
Expand Down
Expand Up @@ -18,9 +18,8 @@
package org.apache.ignite.jdbc; package org.apache.ignite.jdbc;


import org.apache.ignite.IgniteCache; import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*; import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.query.*; import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*; import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.spi.discovery.tcp.*; import org.apache.ignite.spi.discovery.tcp.*;
Expand Down Expand Up @@ -259,19 +258,19 @@ public void testCalculatedValue() throws Exception {
@SuppressWarnings("UnusedDeclaration") @SuppressWarnings("UnusedDeclaration")
private static class Person implements Serializable { private static class Person implements Serializable {
/** ID. */ /** ID. */
@CacheQuerySqlField @QuerySqlField
private final int id; private final int id;


/** Name. */ /** Name. */
@CacheQuerySqlField(index = false) @QuerySqlField(index = false)
private final String name; private final String name;


/** Age. */ /** Age. */
@CacheQuerySqlField @QuerySqlField
private final int age; private final int age;


/** Organization ID. */ /** Organization ID. */
@CacheQuerySqlField @QuerySqlField
private final int orgId; private final int orgId;


/** /**
Expand All @@ -298,11 +297,11 @@ private Person(int id, String name, int age, int orgId) {
@SuppressWarnings("UnusedDeclaration") @SuppressWarnings("UnusedDeclaration")
private static class Organization implements Serializable { private static class Organization implements Serializable {
/** ID. */ /** ID. */
@CacheQuerySqlField @QuerySqlField
private final int id; private final int id;


/** Name. */ /** Name. */
@CacheQuerySqlField(index = false) @QuerySqlField(index = false)
private final String name; private final String name;


/** /**
Expand Down
Expand Up @@ -18,9 +18,8 @@
package org.apache.ignite.jdbc; package org.apache.ignite.jdbc;


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.cache.*;
import org.apache.ignite.cache.affinity.*; import org.apache.ignite.cache.affinity.*;
import org.apache.ignite.cache.query.*; import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*; import org.apache.ignite.configuration.*;
import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.spi.discovery.tcp.*; import org.apache.ignite.spi.discovery.tcp.*;
Expand Down Expand Up @@ -285,15 +284,15 @@ public void testGetColumns() throws Exception {
@SuppressWarnings("UnusedDeclaration") @SuppressWarnings("UnusedDeclaration")
private static class Person implements Serializable { private static class Person implements Serializable {
/** Name. */ /** Name. */
@CacheQuerySqlField(index = false) @QuerySqlField(index = false)
private final String name; private final String name;


/** Age. */ /** Age. */
@CacheQuerySqlField @QuerySqlField
private final int age; private final int age;


/** Organization ID. */ /** Organization ID. */
@CacheQuerySqlField @QuerySqlField
private final int orgId; private final int orgId;


/** /**
Expand All @@ -318,11 +317,11 @@ private Person(String name, int age, int orgId) {
@SuppressWarnings("UnusedDeclaration") @SuppressWarnings("UnusedDeclaration")
private static class Organization implements Serializable { private static class Organization implements Serializable {
/** ID. */ /** ID. */
@CacheQuerySqlField @QuerySqlField
private final int id; private final int id;


/** Name. */ /** Name. */
@CacheQuerySqlField(index = false) @QuerySqlField(index = false)
private final String name; private final String name;


/** /**
Expand Down
Expand Up @@ -18,7 +18,7 @@
package org.apache.ignite.jdbc; package org.apache.ignite.jdbc;


import org.apache.ignite.*; import org.apache.ignite.*;
import org.apache.ignite.cache.query.*; import org.apache.ignite.cache.query.annotations.*;
import org.apache.ignite.configuration.*; import org.apache.ignite.configuration.*;
import org.apache.ignite.spi.discovery.tcp.*; import org.apache.ignite.spi.discovery.tcp.*;
import org.apache.ignite.spi.discovery.tcp.ipfinder.*; import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
Expand Down Expand Up @@ -657,63 +657,63 @@ public void testUrl() throws Exception {
@SuppressWarnings("UnusedDeclaration") @SuppressWarnings("UnusedDeclaration")
private static class TestObject implements Serializable { private static class TestObject implements Serializable {
/** */ /** */
@CacheQuerySqlField(index = false) @QuerySqlField(index = false)
private final int id; private final int id;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Boolean boolVal; private Boolean boolVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Byte byteVal; private Byte byteVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Short shortVal; private Short shortVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Integer intVal; private Integer intVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Long longVal; private Long longVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Float floatVal; private Float floatVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Double doubleVal; private Double doubleVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private BigDecimal bigVal; private BigDecimal bigVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private String strVal; private String strVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private byte[] arrVal; private byte[] arrVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Date dateVal; private Date dateVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Time timeVal; private Time timeVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private Timestamp tsVal; private Timestamp tsVal;


/** */ /** */
@CacheQuerySqlField @QuerySqlField
private URL urlVal; private URL urlVal;


/** /**
Expand Down

0 comments on commit 8be3faa

Please sign in to comment.