Elffuss BraidHub

kikocis/java-driver public

1ebb28e6921d · 1.9 KiBRawPermalink
1/*
2 * Copyright (C) 2012-2015 DataStax Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package com.datastax.driver.mapping.annotations;
17
18import java.lang.annotation.ElementType;
19import java.lang.annotation.Retention;
20import java.lang.annotation.RetentionPolicy;
21import java.lang.annotation.Target;
22
23/**
24 * Annotation that allows to specify the name of the CQL column to which the
25 * field should be mapped.
26 * <p/>
27 * Note that this annotation is generally optional in the sense that any field
28 * of a class annotated by {@link Table} will be mapped by default to a column
29 * having the same name than this field unless that field has the
30 * {@link Transient} annotation. As such, this annotation is mainly useful when
31 * the name to map the field to is not the same one that the field itself (but
32 * can be added without it's name parameter for documentation sake).
33 */
34@Target(ElementType.FIELD)
35@Retention(RetentionPolicy.RUNTIME)
36public @interface Column {
37 /**
38 * Name of the column being mapped in Cassandra. By default, the name of the
39 * field will be used.
40 *
41 * @return the name of the mapped column in Cassandra, or {@code ""} to use
42 * the field name.
43 */
44 String name() default "";
45
46 /**
47 * Whether the column name is a case sensitive one.
48 *
49 * @return whether the column name is a case sensitive one.
50 */
51 boolean caseSensitive() default false;
52}