All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.driver.mapping.annotations.Frozen Maven / Gradle / Ivy

There is a newer version: 4.15.102
Show newest version
/*
 * Copyright DataStax, Inc.
 *
 * This software can be used solely with DataStax Enterprise. Please consult the license at
 * http://www.datastax.com/terms/datastax-dse-driver-license-terms
 */
package com.datastax.driver.mapping.annotations;

import com.datastax.driver.core.DataType;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Specifies that the property decorated with this annotation maps to a CQL type that is {@link
 * DataType#isFrozen() frozen}, or contains frozen subtypes.
 *
 * 

This annotation is purely informational at this stage, the validity of the declaration is not * checked. But will become useful when a schema generation feature is added to the mapper. * Therefore it is a good idea to keep frozen declarations up-to-date. * * @see FrozenKey * @see FrozenValue */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface Frozen { // Implementation note: frozen annotations were previously checked at runtime, this code can be // found in version 2.1.7 /** * Contains the full CQL type of the target column. As a convenience, this can be left out when * only the top-level type is frozen. * *

Examples: * *

   * // Will map to frozen<user>
   * @Frozen
   * private User user;
   *
   * @Frozen("map<text, map<text, frozen<user>>>")
   * private Map<String, Map<String, User>> m;
   * 
* *

Also consider the {@link FrozenKey @FrozenKey} and {@link FrozenValue @FrozenValue} * shortcuts for simple collections. * * @return the full CQL type of the target column. */ String value() default ""; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy