JeeWiz Home

 
  
 
Contents  >   7.  GigaSystemBuilder Profile Reference
 


7.9 Field Object

Used on
class
javaBean
DescriptionThis is an extension of the field from the business object level for use in GigaSpace spaces.
Contained
Lists
1
Name  annotation
Type  String
Description  An optional list, comma-separated, of Java annotations.

You can put the '@' as the first character on the annotation, but it is not necessary.

You can add the annotation as either

    • an XML element, with the CDATA being the annotation text
    • a property which can contain multiple annotations, comma-separated.
If you use the property form, you cannot add multiple element-pair values as the syntax conflicts with the comma-separation syntax. In other words, annotation="@Annotation(id=27,name='Fred')" will be parsed into two separate annotations, and then inserted into the code as "@Annotation(id=27" and "@name='Fred')", which is incorrect syntax.

Because of this, some modelling environments allow annotations to be added as a property (this is most convenient) and as a list (this allows complex annotations).
Unique  false
Inherited
properties
template (base property)

text (base property)

jwpattern (base property)

 7.9.1  Property 'access'
 7.9.2  Property 'autoGenerate'
 7.9.3  Property 'default'
 7.9.4  Property 'description'
 7.9.5  Property 'final'
 7.9.6  Property 'id'
 7.9.7  Property 'inSpace'
 7.9.8  Property 'index'
 7.9.9  Property 'name'
 7.9.10  Property 'persist'
 7.9.11  Property 'routing'
 7.9.12  Property 'static'
 7.9.13  Property 'type'

7.9.1  Property 'access'
DescriptionSpecifies the access control for the attribute.

The default access is specifically null, so that there is no access control value placed in the code. This is necessary because the default for the access changes depending on the context.
TypeString
Choices private (default)
protected
public
Default\null

7.9.2  Property 'autoGenerate'
Aliasautokey
DescriptionMust only be used on field with id=true, and if true indicates that GigaSpaces should generate the value of the field.
Typeboolean
Defaultfalse

7.9.3  Property 'default'
DescriptionSpecifies a default value to which the field will be set when created.

This is an expression which should be compatible with the field's 'type', or the generated program will not compile. For primitive types, this will typically be just the literal value of the default, although it can be an expression. Note that you should just specify the value part for numeric values, not a type-defining suffix. For example, you must specify "0" rather that "0L".

For non-string objects, the default should create an object - e.g. 'new Integer(8)'.

String defaults are assumed to be string literals less the surrounding "". They will have double-quotes added automatically, so the default is a String constant - e.g. Fred goes into the code as "Fred".

You can alter this action, to specify expressions for string defaults, by prefixing the expression with '\', which will be stripped off. You can also start and end the default string value with '"', in which case it will not be altered.

String examples:

input: Fred code: "Fred"

input: \otherfield.substring(1) code: otherfield.substring(1)

input: \"" code: ""

The default expression as processed by the above algorithm can be retrieved via the method getDefaultExpression().
TypeString

7.9.4  Property 'description'
DescriptionOptional description.

Use this to
  1. document the meaning of a particular item
  2. specify functionality at the design stage for implementation later.
TypeString

7.9.5  Property 'final'
DescriptionThis is the Java 'final' attribute. There are two methods for reading this out, for use on a field or on a class, because these have different names in CSharp.

The generic 'getFinalText()' is used on parameters in Java.
Typeboolean
Defaultfalse

7.9.6  Property 'id'
DescriptionDeclares that this field is to be the basis for the bean's UID when written into a space.

Only one field in Java bean can be marked with the 'id' field.
Typeboolean
Defaultfalse

7.9.7  Property 'inSpace'
DescriptionDefines if this field data is to be included in space entries.

The default for this field is taken from the bean's 'includeProperties' property.

(The bean being the parent object of the field - a JavaBean or entity, for example.)

For example, if the bean's includeProperties is not set - and so defaults to true - by default, fields are in the space entry, and you must explicitly set this 'inSpace' property to false to remove them.

This property generates the GigaSpaces @SpaceProperty or @SpaceExclude depending on the context.

Space* objects (e.g. SpaceHashMap) will automatically have this field set false, so the Space object does not itself get written into a space.
Typeboolean

7.9.8  Property 'index'
Aliasindexed
DescriptionDefines if this field data is indexed. Indexing speeds up read and take operations.
Typeboolean
Defaultfalse

7.9.9  Property 'name'
DescriptionSpecifies the identifier for the field or parameter. This must follow the rules for identifiers (start with a letter or '_', not include '.' etc.).
TypeString
Requiredtrue

7.9.10  Property 'persist'
DescriptionIndicates that this field is the one to use to decide whether to persist this bean instance. Presumably, the GigaSpaces runtime will call the getter method for this field before persisting the object.

This field only has any effect if the parent bean's 'persist' property is set.

Only one field in Java bean can be marked with the 'persist' field.
Typeboolean
Defaultfalse

7.9.11  Property 'routing'
DescriptionIndicates that this field is the one to use to decide which partitioned space to target for space operations (read, write etc.)
Typeboolean
Defaultfalse

7.9.12  Property 'static'
DescriptionThis is the 'static' modifier.
Typeboolean
Defaultfalse

7.9.13  Property 'type'
DescriptionSpecifies the object type and may be the name of a primitive type or a class.

If the type is a class and the code requires you to qualify it (because it is ambiguous in one or more compiled files) you will have to add the qualifying package information yourself.

To specify an array, add '[]' on the end of the type, just as you would in a normal array declaration.
TypeString
DefaultString

Copyright (c) 2001-2009 New Technology/enterprise Ltd.