Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 // Copyright 2008 Google Inc.
 // Licensed 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
 // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
Annotation marking an entity field for persistence in the data store.

Fields marked with Column must not be final and must not be private. Fields which might be accessed cross-packages (such as those declared in a common Key type like StringKey) must be declared with public access so generated code can access them directly.

public @interface Column {
Special value for name() to indicate the name is empty.
  public static final String NONE = "--NONE--";


unique identity of this field within its parent object.
  int id();


name of the column in the data store. Defaults to the field name.
  String name() default "";


maximum length (in characters). Only valid for String.
  int length() default 0;


is a value required. Defaults to true (NOT NULL).
  boolean notNull() default true;
New to GrepCode? Check out our FAQ X