Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2013-2014 Sappenin Inc. (developers@sappenin.com) 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 http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package com.sappenin.objectify.annotation;

When placed on an entity field of type Money or BigMoney, the following properties will be stored for that property:

  • The currency value, encoded as a lexigraphically-encoded String.
  • The currency code, as a String
  • (Optional) Currency value in human-readable format (enabled by default)

To customize the behavior of this annotation, the following properties may be set:

  • storeDisplayableAmount: Set to true to store a displayable currency amount for human-readability in the App Engine Datastore Viewer (defaults to true).

  • indexDisplayableAmount: Set to to index the displayableAmount property (defaults to false).
      Note that this value will not index properly, so this should generally not be used.

  • displayableAmountFieldName: The property-name to store the displayableAmount in Appengine Datastore Entities. (defaults to 'displayableAmount').

  • encodedAmountFieldName: The property-name to store the encodedAmount value in Appengine Datastore Entities. (defaults to 'encodedAmount').

  • indexEncodedAmount: Set to true to index the encodedAmount property (defaults to true).

  • indexCurrencyCode: Set to true to index the currencyCode property (defaults to false).

  • currencyCodeFieldName: The property-name to store the currencyCode value in Appengine Datastore Entities. (defaults to 'currencyCode').

Author(s):
David Fuelling
public @interface Money
	boolean storeDisplayableAmount() default true;
	boolean indexDisplayableAmount() default false;
	String displayableAmountFieldName() default "displayableAmount";
	String encodedAmountFieldName() default "encodedAmount";
	boolean indexEncodedAmount() default true;
	String currencyCodeFieldName() default "currencyCode";
	boolean indexCurrencyCode() default false;
New to GrepCode? Check out our FAQ X