info.archinnov.achilles.annotations.MaterializedView Maven / Gradle / Ivy
/*
* Copyright (C) 2012-2016 DuyHai DOAN
*
* 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 info.archinnov.achilles.annotations;
import java.lang.annotation.*;
/**
* Marks a class as a materialized view and let Achilles manage it
*
* {@literal @}MaterializedView(baseEntity = UserEntity.class)
* public class UserByCountryView {...}
*
*
* @see @MaterializedView
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
public @interface MaterializedView {
/**
* (Mandatory) The entity class from which this materialized view is derived.
*
*
*
* {@literal @}MaterializedView(baseEntity = UserEntity.class, keyspace="production_data", view = "user_by_country")
* public class UserByCountryView {...}
*
*/
Class> baseEntity();
/**
* (Optional) The name of the keyspace in which this materialized view belongs to.
* If not set explicitly on the entity, Achilles will use the current
* keyspace of the java driver Session object.
*
*
* {@literal @}MaterializedView(baseEntity = UserEntity.class, keyspace="production_data", view = "user_by_country")
* public class UserByCountryView {...}
*
*/
String keyspace() default "";
/**
* (Optional) The name of the materialized view. Defaults to the short class name.
* Ex: for the class xxx.xxx.UserByCountryView, the
* default table name will be userbycountryview if the attribute view is not set.
*
*
* {@literal @}MaterializedView(baseEntity = UserEntity.class, view = "user_by_country")
* public class UserByCountryView {...}
*
*/
String view() default "";
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy