blob: f33c5e23fdbef9f31de49818f803ffbe0ccd13a6 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>@Collection :: Apache Isis</title>
<link rel="canonical" href="https://isis.apache.org/refguide/2.0.0-M3/applib-ant/Collection.html">
<meta name="generator" content="Antora 2.2.0">
<link rel="stylesheet" href="../../../_/css/site.css">
<link rel="stylesheet" href="../../../_/css/site-custom.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700" rel="stylesheet">
<link rel="home" href="https://isis.apache.org" title="Apache Isis">
<link rel="next" href="CollectionLayout.html" title="CollectionLayout">
<link rel="prev" href="ActionLayout.html" title="ActionLayout">
</head>
<body class="article">
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="https://isis.apache.org">
<span class="icon">
<img src="../../../_/img/isis-logo-48x48.png"></img>
</span>
<span>Apache Isis</span>
</a>
<button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div id="topbar-nav" class="navbar-menu">
<a class="navbar-end">
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Quick Start</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Starter Apps</span>
<a class="navbar-item" href="../../../docs/2.0.0-M3/starters/helloworld.html">Hello World</a>
<a class="navbar-item" href="../../../docs/2.0.0-M3/starters/simpleapp.html">Simple App</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Demos &amp; Tutorials</span>
<a class="navbar-item" href="../../../docs/2.0.0-M3/demo/about.html">Demo App</a>
<a class="navbar-item" href="https://danhaywood.gitlab.io/isis-petclinic-tutorial-docs/petclinic/1.16.2/intro.html">Petclinic (tutorial)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Resources</span>
<a class="navbar-item" href="../../../docs/2.0.0-M3/resources/cheatsheet.html">Cheatsheet</a>
<a class="navbar-item" href="../../../docs/2.0.0-M3/resources/icons.html">Icons</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Guides</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Development</span>
<a class="navbar-item" href="../../../setupguide/2.0.0-M3/about.html">Setup Guide</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Core</span>
<a class="navbar-item" href="../../../userguide/2.0.0-M3/about.html">User Guide</a>
<a class="navbar-item" href="../../../refguide/2.0.0-M3/about.html">Reference Guide</a>
<a class="navbar-item" href="../../../testing/2.0.0-M3/about.html">Testing Guide</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Libraries</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">For Use in Apps</span>
<a class="navbar-item" href="../../../subdomains/2.0.0-M3/about.html">Subdomain Libraries</a>
<a class="navbar-item" href="../../../valuetypes/2.0.0-M3/about.html">Value Types</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Integrate between Apps</span>
<a class="navbar-item" href="../../../mappings/2.0.0-M3/about.html">Bounded Context Mapping Libraries</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Other</span>
<a class="navbar-item" href="../../../incubator/2.0.0-M3/about.html">Incubator</a>
<a class="navbar-item" href="../../../legacy/2.0.0-M3/about.html">Legacy</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Components</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Viewers</span>
<a class="navbar-item" href="../../../vw/2.0.0-M3/about.html">Wicket UI</a>
<a class="navbar-item" href="../../../vro/2.0.0-M3/about.html">Restful Objects (REST)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Security</span>
<a class="navbar-item" href="../../../security/2.0.0-M3/about.html">Security Guide</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Persistence</span>
<a class="navbar-item" href="../../../pjdo/2.0.0-M3/about.html">DataNucleus (JDO)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Extensions</span>
<a class="navbar-item" href="../../../extensions/2.0.0-M3/about.html">Extensions Catalog</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Support</a>
<div class="navbar-dropdown">
<span class="navbar-item navbar-heading">Contact</span>
<a class="navbar-item" href="../../../docs/2.0.0-M3/support/slack-channel.html">Slack</a>
<a class="navbar-item" href="../../../docs/2.0.0-M3/support/mailing-list.html">Mailing Lists</a>
<a class="navbar-item" href="https://issues.apache.org/jira/browse/ISIS">JIRA</a>
<a class="navbar-item" href="https://stackoverflow.com/questions/tagged/isis">Stack Overflow</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Releases</span>
<a class="navbar-item" href="../../../docs/2.0.0-M3/downloads/how-to.html">Downloads</a>
<a class="navbar-item" href="../../../relnotes/2.0.0-M3/about.html">Release Notes</a>
<a class="navbar-item" href="../../../docs/2.0.0-M3/archive/1-x.html">Archive (1.x)</a>
<hr class="navbar-divider"/>
<span class="navbar-item navbar-heading">Framework</span>
<a class="navbar-item" href="../../../conguide/2.0.0-M3/about.html">Contributors' Guide</a>
<a class="navbar-item" href="../../../comguide/2.0.0-M3/about.html">Committers' Guide</a>
<a class="navbar-item" href="../../../core/2.0.0-M3/about.html">Core Design</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">ASF</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="http://www.apache.org/">Apache Homepage</a>
<a class="navbar-item" href="https://www.apache.org/events/current-event">Events</a>
<a class="navbar-item" href="https://www.apache.org/licenses/">Licenses</a>
<a class="navbar-item" href="https://www.apache.org/security/">Security</a>
<a class="navbar-item" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a>
<a class="navbar-item" href="https://www.apache.org/foundation/thanks.html">Thanks</a>
<hr class="navbar-divider"/>
<a class="navbar-item" href="https://whimsy.apache.org/board/minutes/Isis.html">PMC board minutes</a>
</div>
</div>
<a class="navbar-item" href="../../../docs/2.0.0-M3/about.html">
<span class="icon">
<img src="../../../_/img/home.png"></img>
</span>
</a>
</div>
</div>
</nav>
</header>
<div class="body ">
<div class="nav-container" data-component="refguide" data-version="2.0.0-M3">
<aside class="nav">
<div class="panels">
<div class="nav-panel-pagination">
<a class="page-previous" rel="prev" href="ActionLayout.html" title="ActionLayout"><span></span></a>
<a class="page-next" rel="next"
href="CollectionLayout.html" title="CollectionLayout"><span></span></a>
<!--
page.parent doesn't seem to be set...
<a class="page-parent" rel="prev" href="about.html" title="ActionLayout"><span></span></a>
-->
</div>
<div class="nav-panel-menu is-active" data-panel="menu">
<nav class="nav-menu">
<h3 class="title"><a href="../about.html">Reference Guide</a></h3>
<ul class="nav-list">
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="about.html">Annotations</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Action.html">Action</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="ActionLayout.html">ActionLayout</a>
</li>
<li class="nav-item is-current-page" data-depth="2">
<a class="nav-link" href="Collection.html">Collection</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="CollectionLayout.html">CollectionLayout</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Column.html">Column</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Digits.html">Digits</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Discriminator.html">Discriminator</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="DomainObject.html">DomainObject</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="DomainObjectLayout.html">DomainObjectLayout</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="DomainService.html">DomainService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="DomainServiceLayout.html">DomainServiceLayout</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Facets.html">Facets</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="HomePage.html">HomePage</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="MemberOrder.html">MemberOrder</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Mixin.html">Mixin</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="NotPersistent.html">NotPersistent.</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Nullable.html">Nullable</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="MinLength.html">MinLength</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Parameter.html">Parameter</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="ParameterLayout.html">ParameterLayout</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Pattern.html">Pattern</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="PersistenceCapable.html">PersistenceCapable</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="PrimaryKey.html">PrimaryKey</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Programmatic.html">Programmatic</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Property.html">Property</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="PropertyLayout.html">PropertyLayout</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="IsisSessionScope.html">RequestScoped</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="Title.html">Title</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="ViewModel.html">ViewModel</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="XmlJavaTypeAdapter.html">XmlJavaTypeAdapter</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="XmlRootElement.html">XmlRootElement</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../applib-methods/about.html">Methods</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-methods/prefixes.html">Supporting Method Prefixes</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-methods/reserved.html">Reserved Methods</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-methods/lifecycle.html">Lifecycle Methods</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../applib-classes/about.html">Classes</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-classes/events.html">Events</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-classes/ViewModel.html"><code>ViewModel</code></a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-classes/value-types.html">Value Types</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-classes/spec.html">Specification pattern</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-classes/i18n.html">i18n support</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-classes/roles-mixins-contributees.html">Roles, Mixins and Contributees</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-classes/utility.html">Utility Classes</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-classes/layout.html">Layout</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../applib-svc/about.html">Domain Services</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/AcceptHeaderService.html">AcceptHeaderService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/ApplicationFeatureRepository.html">ApplicationFeatureRepository</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/AuditerService.html">AuditerService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/BookmarkService.html">BookmarkService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/BookmarkUiService.html">BookmarkUiService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/ClockService.html">ClockService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/CommandContext.html">CommandContext</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/CommandDtoProcessorService.html">CommandDtoProcessorService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/CommandExecutorService.html">CommandExecutorService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/CommandService.html">CommandService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/ConfigurationMenu.html">ConfigurationMenu</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/ConfigurationViewService.html">ConfigurationViewService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/ContentMappingService.html">ContentMappingService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/DeepLinkService.html">DeepLinkService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/EmailNotificationService.html">EmailNotificationService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/EmailService.html">EmailService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/ErrorReportingService.html">ErrorReportingService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/EventBusService.html">EventBusService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/ExceptionRecognizerService.html">ExceptionRecognizerService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/FactoryService.html">FactoryService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/GridLoaderService.html">GridLoaderService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/GridService.html">GridService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/GridSystemService.html">GridSystemService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/HealthCheckService.html">HealthCheckService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/HintStore.html">HintStore</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/HomePageResolverService.html">HomePageResolverService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/InteractionContext.html">InteractionContext</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/JaxbService.html">JaxbService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/LayoutService.html">LayoutService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/LayoutServiceMenu.html">LayoutServiceMenu</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/LocaleProvider.html">LocaleProvider</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/MenuBarsLoaderService.html">MenuBarsLoaderService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/MenuBarsService.html">MenuBarsService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/MessageService.html">MessageService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/MetaModelService.html">MetamodelService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/MetaModelServiceMenu.html">MetamodelServiceMenu</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/MetricsService.html">MetricsService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/PublisherService.html">PublisherService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/QueryResultsCache.html">QueryResultsCache</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/RepositoryService.html">RepositoryService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/RoutingService.html">RoutingService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/Scratchpad.html">Scratchpad</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/ServiceInjector.html">ServiceInjector</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/ServiceRegistry.html">ServiceRegistry</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/SessionLoggingService.html">SessionLoggingService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/SudoService.html">SudoService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/SwaggerService.html">SwaggerService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/TableColumnOrderService.html">TableColumnOrderService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/TitleService.html">TitleService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/TranslationService.html">TranslationService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/TranslationsResolver.html">TranslationsResolver</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/TransactionService.html">TransactionService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/UrlEncodingService.html">UrlEncodingService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/UserProfileService.html">UserProfileService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/UserRegistrationService.html">UserRegistrationService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/UserService.html">UserService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/WrapperFactory.html">WrapperFactory</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/XmlService.html">XmlService</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../applib-svc/XmlSnapshotService.html">XmlSnapshotService</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../config/about.html">Configuration</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.applib.html">Applib</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.core.meta-model.html">Core MetaModel</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.core.meta-model.introspector.html">Core MetaModel Introspection</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.core.meta-model.validator.html">MetaModel Validator</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.core.runtime.html">Core Runtime Services configurations</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.core.runtime-services.html">Core Runtime Services configurations</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.security.shiro.html">Shiro Security Implementation</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.persistence.jdo-datanucleus.html">JDO DataNucleus</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.persistence.jdo-datanucleus.impl.html">DataNucleus Configuration</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.viewer.restfulobjects.html">Restful Objects Viewer</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.viewer.wicket.html">Wicket Viewer</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.extensions.html">Extensions</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.value-types.html">Value types</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.testing.html">Testing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/isis.legacy.html">Legacy</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/resteasy.html">RestEasy Configuration</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../config/sections/Other.html">Other</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../schema/about.html">Schema</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../schema/mml.html">MetaModel</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../schema/cmd.html">Command</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../schema/ixn.html">Interaction</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../schema/chg.html">Changes</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../schema/common.html">Common</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="nav-panel-explore" data-panel="explore">
<div class="context">
<span class="title">Reference Guide</span>
<span class="version">2.0.0-M3</span>
</div>
<ul class="components">
<li class="component">
<span class="title"> </span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../docs/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">BC Mappings Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../mappings/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Committers' Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../comguide/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Contributors' Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../conguide/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Design Docs</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../core/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Extensions Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../extensions/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Incubator Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../incubator/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">JDO/DataNucleus</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../pjdo/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Legacy Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../legacy/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component is-current">
<span class="title">Reference Guide</span>
<ul class="versions">
<li class="version is-current is-latest">
<a href="../about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Release Notes</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../relnotes/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Restful Objects Viewer</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../vro/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Security Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../security/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Setup Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../setupguide/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Subdomains Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../subdomains/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Testing Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../testing/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">User Guide</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../userguide/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Value Types Catalog</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../valuetypes/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
<li class="component">
<span class="title">Wicket Viewer</span>
<ul class="versions">
<li class="version is-latest">
<a href="../../../vw/2.0.0-M3/about.html">2.0.0-M3</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</aside>
</div>
<main role="main">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
<a href="../../../docs/2.0.0-M3/about.html" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ul>
<li><a href="../about.html">Reference Guide</a></li>
<li><a href="about.html">Annotations</a></li>
<li><a href="Collection.html">Collection</a></li>
</ul>
</nav>
<div class="edit-this-page"><a href="https://github.com/apache/isis/edit/2.0.0-M3/api/applib/src/main/adoc/modules/applib-ant/pages/Collection.adoc">Edit</a></div>
</div>
<article class="doc">
<a name="section-top"></a>
<h1 class="page"><code>@Collection</code></h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>The <code>@Collection</code> annotation applies to collections collecting together all domain semantics within a single annotation.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@Inherited
@Target({
ElementType.METHOD,
ElementType.FIELD,
ElementType.TYPE,
ElementType.ANNOTATION_TYPE
})
@Retention(RetentionPolicy.RUNTIME)
@Mixin(method = "coll")
public @interface Collection {
Class&lt;? extends CollectionDomainEvent&lt;?,?&gt;&gt; domainEvent() <i class="conum" data-value="1"></i><b>(1)</b>
default CollectionDomainEvent.Default.class;
Editing editing() <i class="conum" data-value="2"></i><b>(2)</b>
default Editing.NOT_SPECIFIED;
String editingDisabledReason() <i class="conum" data-value="3"></i><b>(3)</b>
default "";
Where hidden() <i class="conum" data-value="4"></i><b>(4)</b>
default Where.NOT_SPECIFIED;
MementoSerialization mementoSerialization() <i class="conum" data-value="5"></i><b>(5)</b>
default MementoSerialization.NOT_SPECIFIED;
Class&lt;?&gt; typeOf() <i class="conum" data-value="6"></i><b>(6)</b>
default Object.class;
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td><a href="#domainEvent"><code>domainEvent()</code></a>
<div class="paragraph">
<p>The event type to be posted to the <a href="../applib-svc/EventBusService.html" class="page"><code>EventBusService</code></a> to broadcast the collection&#8217;s business rule checking (hide, disable, validate) and its modification (before and after).</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td><a href="#editing"><code>editing()</code></a>
<div class="paragraph">
<p>Whether a collection can be added to or removed from within the UI</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td><code>editingDisabledReason()</code>
<div class="paragraph">
<p>If <code>editing()</code> is <code>DISABLED</code>, provides a reason as to why.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td><a href="#hidden"><code>hidden()</code></a>
<div class="paragraph">
<p>Indicates where (in the UI) the collection should be hidden from the user.</p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="5"></i><b>5</b></td>
<td><a href="#mementoSerialization"><code>memento()</code></a>
<div class="paragraph">
<p>Whether to include/exclude in snapshots.<br></p>
</div></td>
</tr>
<tr>
<td><i class="conum" data-value="6"></i><b>6</b></td>
<td><a href="#typeOf"><code>typeOf()</code></a>
<div class="paragraph">
<p>Hints as to the run-time type of the objects within that collection (as a fallback)</p>
</div></td>
</tr>
</table>
</div>
<div class="paragraph">
<p>For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">public class ToDoItem {
public static class DependenciesChangedEvent
extends CollectionDomainEvent&lt;ToDoItem, ToDoItem&gt; { } <i class="conum" data-value="1"></i><b>(1)</b>
@Collection(
domainEvent=DependenciesChangedEvent.class,
editing = Editing.ENABLED,
hidden = Where.NOWHERE, <i class="conum" data-value="2"></i><b>(2)</b>
notPersisted = false, <i class="conum" data-value="3"></i><b>(3)</b>
typeOf = ToDoItem.class <i class="conum" data-value="4"></i><b>(4)</b>
)
public SortedSet&lt;ToDoItem&gt; getDependencies() { /* ... */ }
...
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>can use no-arg constructor.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>default value, so could be omitted</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>default value, so could be omitted</td>
</tr>
<tr>
<td><i class="conum" data-value="4"></i><b>4</b></td>
<td>default value, so could be omitted</td>
</tr>
</table>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The annotation is one of a handful (others including <a href="CollectionLayout.html" class="page"><code>@CollectionLayout</code></a>, <a href="Property.html" class="page"><code>@Property</code></a> and <a href="PropertyLayout.html" class="page"><code>@PropertyLayout</code></a>) that can also be applied to the field, rather than the getter method. This is specifically
so that boilerplate-busting tools such as <a href="https://projectlombok.org/">Project Lombok</a> can be used.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="domainEvent"><a class="anchor" href="#domainEvent"></a><code>domainEvent()</code></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Whenever a domain object (or list of domain objects) is to be rendered, the framework fires off multiple domain events for every property, collection and action of the domain object.
In the cases of the domain object&#8217;s collections, the events that are fired are:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>hide phase: to check that the collection is visible (has not been hidden)</p>
</li>
<li>
<p>disable phase: to check that the collection is usable (has not been disabled)</p>
</li>
<li>
<p>validate phase: to check that the collection&#8217;s arguments are valid (to add or remove an element)</p>
</li>
<li>
<p>pre-execute phase: before the modification of the collection</p>
</li>
<li>
<p>post-execute: after the modification of the collection</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Subscribers (which must be domain services) subscribe to events posted through the <a href="../applib-svc/EventBusService.html" class="page"><code>EventBusService</code></a>, and can influence each of these phases.</p>
</div>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The <a href="../../../vw/2.0.0-M3/about.html" class="page">Wicket viewer</a> does <em>not</em> currently support the modification of collections; they are rendered read-only.
However, domain events are still relevant to determine if such collections should be hidden.</p>
</div>
<div class="paragraph">
<p>The workaround is to create add/remove actions and use <a href="MemberOrder.html" class="page">UI hints</a> to render them close to the collection.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>By default the event raised is <code>CollectionDomainEvent.Default</code>.
For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import lombok.Getter;
import lombok.Setter;
public class ToDoItem {
@Collection()
@Getter @Setter
private SortedSet&lt;ToDoItem&gt; dependencies = ...
// ...
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The <code>domainEvent</code> attribute allows a custom subclass to be emitted allowing more precise subscriptions (to those subclasses) to be defined instead.</p>
</div>
<div class="paragraph">
<p>For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">public class ToDoItem {
public static class DependenciesChangedEvent
extends CollectionDomainEvent&lt;ToDoItem, ToDoItem&gt; { } <i class="conum" data-value="1"></i><b>(1)</b>
@Collection(
domainEvent=DependenciesChangedEvent.class
)
@Getter @Setter
private SortedSet&lt;ToDoItem&gt; dependencies = ...
// ...
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>inherit from <code>CollectionDomainEvent&lt;T,E&gt;</code> where <code>T</code> is the type of the domain object being interacted with, and <code>E</code> is the type of the element in the collection (both <code>ToDoItem</code> in this example)</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The benefit is that subscribers can be more targetted as to the events that they subscribe to.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The framework provides a no-arg constructor and will initialize the domain event using (non-API) setters rather than through the constructor.
This substantially reduces the boilerplate in the subclasses because no explicit constructor is required..</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="subscribers"><a class="anchor" href="#subscribers"></a>Subscribers</h3>
<div class="paragraph">
<p>Subscribers (which must be domain services) subscribe to events posted through the <a href="../applib-svc/EventBusService.html" class="page"><code>EventBusService</code></a>.</p>
</div>
<div class="paragraph">
<p>Subscribers can be either coarse-grained (if they subscribe to the top-level event type):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import org.springframework.stereotype.Service;
import org.springframework.context.event.EventListener;
@Service
public class SomeSubscriber {
@EventListener(CollectionDomainEvent.class)
public void on(CollectionDomainEvent ev) {
// ...
}
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>or can be fine-grained (by subscribing to specific event subtypes):</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;
@Service
public class SomeSubscriber {
@EventListener(ToDoItem.DependenciesChangedEvent.class)
public void on(ToDoItem.DependenciesChangedEvent ev) {
// ...
}
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The subscriber&#8217;s method is called (up to) 5 times:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>whether to veto visibility (hide)</p>
</li>
<li>
<p>whether to veto usability (disable)</p>
</li>
<li>
<p>whether to veto execution (validate) the element being added to/removed from the collection</p>
</li>
<li>
<p>steps to perform prior to the collection being added to/removed from</p>
</li>
<li>
<p>steps to perform after the collection has been added to/removed from</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The subscriber can distinguish these by calling <code>ev.getEventPhase()</code>.
Thus the general form is:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java"> import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;
@Service
public class SomeSubscriber {
@EventListener(CollectionDomainEvent.class)
public void on(CollectionDomainEvent ev) {
switch(ev.getEventPhase()) {
case HIDE: <i class="conum" data-value="1"></i><b>(1)</b>
break;
case DISABLE: <i class="conum" data-value="2"></i><b>(2)</b>
break;
case VALIDATE: <i class="conum" data-value="3"></i><b>(3)</b>
break;
case EXECUTING:
break;
case EXECUTED:
break;
}
}
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>call <code>ev.hide()</code> or <code>ev.veto("")</code> to hide the collection</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>call <code>ev.disable("&#8230;&#8203;")</code> or <code>ev.veto("&#8230;&#8203;")</code> to disable the collection</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>call ev.invalidate("&#8230;&#8203;") or ev.veto("&#8230;&#8203;") if object being added/removed to collection is invalid</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>It is also possible to abort the transaction during the executing or executed phases by throwing an exception.
If the exception is a subtype of <code>RecoverableException</code> then the exception will be rendered as a user-friendly warning (eg Growl/toast) rather than an error.</p>
</div>
</div>
<div class="sect2">
<h3 id="default-doop-and-noop-events"><a class="anchor" href="#default-doop-and-noop-events"></a>Default, Doop and Noop events</h3>
<div class="paragraph">
<p>If the <code>domainEvent</code> attribute is not explicitly specified (is left as its default value, <code>CollectionDomainEvent.Default</code>), then the framework will, by default, post an event.</p>
</div>
<div class="paragraph">
<p>If this is not required, then the <code>isis.reflector.facet.collectionAnnotation.domainEvent.postForDefault</code> configuration collection can be set to "false"; this will disable posting.</p>
</div>
<div class="paragraph">
<p>On the other hand, if the <code>domainEvent</code> has been explicitly specified to some subclass, then an event will be posted.
The framework provides <code>CollectionDomainEvent.Doop</code> as such a subclass, so setting the <code>domainEvent</code> attribute to this class will ensure that the event to be posted, irrespective of the configuration collection setting.</p>
</div>
<div class="paragraph">
<p>And, conversely, the framework also provides <code>CollectionDomainEvent.Noop</code>; if <code>domainEvent</code> attribute is set to this class, then no event will be posted.</p>
</div>
</div>
<div class="sect2">
<h3 id="raising-events-programmatically"><a class="anchor" href="#raising-events-programmatically"></a>Raising events programmatically</h3>
<div class="paragraph">
<p>Normally events are only raised for interactions through the UI.
However, events can be raised programmatically either by calling the <a href="../applib-svc/EventBusService.html" class="page"><code>EventBusService</code></a> API directly, or by emulating the UI by wrapping the target object using the <a href="../applib-svc/WrapperFactory.html" class="page"><code>WrapperFactory</code></a> domain service.</p>
</div>
</div>
<div class="sect2">
<h3 id="see-also"><a class="anchor" href="#see-also"></a>See also</h3>
<div class="paragraph">
<p>This attribute is also supported for:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="Action.html#domainEvent" class="page">actions</a> and</p>
</li>
<li>
<p><a href="Property.html#domainEvent" class="page">properties</a>.</p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="editing"><a class="anchor" href="#editing"></a><code>editing()</code></h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>editing()</code> annotation indicates whether a collection can be added to or removed from within the UI.</p>
</div>
<div class="paragraph">
<p>The related <code>editingDisabledReason</code> attribute specifies the a hard-coded reason why the collection cannot be modified directly.</p>
</div>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
<div class="paragraph">
<p>The <a href="../../../vw/2.0.0-M3/about.html" class="page">Wicket viewer</a> does <strong>not</strong> currently support the modification of collections; they are rendered read-only.</p>
</div>
<div class="paragraph">
<p>The workaround is to create add/remove actions and use <a href="MemberOrder.html" class="page">UI hints</a> to render them close to the collection.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Whether a collection is enabled or disabled depends upon these factors:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>whether the domain object has been configured as immutable through the <a href="DomainObject.html#editing" class="page"><code>@DomainObject#editing()</code></a> attribute</p>
</li>
<li>
<p>else (that is, if the domain object&#8217;s editability is specified as being <code>AS_CONFIGURED</code>), then the value of the
<a href="../config/sections/isis.applib.html#isis.applib.annotation.domain-object.editing" class="page">'isis.applib.annotation.domain-object.editing'</a> configuration property.
If set to <code>false</code>, then the object&#8217;s collections (and properties) are <strong>not</strong> editable</p>
</li>
<li>
<p>else, then the value of the <code>@Collection(editing=&#8230;&#8203;)</code> attribute itself.</p>
</li>
<li>
<p>else, the result of invoking any supporting <a href="../applib-methods/prefixes.html#disable" class="page"><code>disable&#8230;&#8203;()</code></a> supporting methods</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Thus, to make a collection read-only even if the object would otherwise be editable, use:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import lombok.Getter;
import lombok.Setter;
public class ToDoItem {
@Collection(
editing=Editing.DISABLED,
editingDisabledReason="Use the add and remove actions to modify"
)
@Getter @Setter
private SortedSet&lt;ToDoItem&gt; dependencies = ...
}</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>To reiterate, it is <em>not</em> possible to enable editing for a collection if editing has been disabled at the object-level.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="see-also-2"><a class="anchor" href="#see-also-2"></a>See also</h3>
<div class="paragraph">
<p>This attribute can also be specified for:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="Property.html#editing" class="page">properties</a></p>
</li>
<li>
<p><a href="DomainObject.html#editing" class="page">domain object</a></p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="hidden"><a class="anchor" href="#hidden"></a><code>hidden()</code></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Collections can be hidden at the domain-level, indicating that they are not visible to the end-user.</p>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>It is also possible to use <a href="CollectionLayout.html#hidden" class="page"><code>@CollectionLayout#hidden</code></a> or using <a href="../../../userguide/2.0.0-M3/fun/ui.html#object-layout" class="page">file-based layout</a> such that the collection can be hidden at the view layer.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import lombok.Getter;
import lombok.Setter;
public class Customer {
@Collection(where=Where.EVERYWHERE)
@Getter @Setter
private SortedSet&lt;Address&gt; addresses = ...
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The acceptable values for the <code>where</code> parameter are:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>Where.EVERYWHERE</code> or <code>Where.ANYWHERE</code><br></p>
<div class="paragraph">
<p>The collection should be hidden everywhere.</p>
</div>
</li>
<li>
<p><code>Where.ANYWHERE</code><br></p>
<div class="paragraph">
<p>Synonym for everywhere.</p>
</div>
</li>
<li>
<p><code>Where.OBJECT_FORMS</code><br></p>
<div class="paragraph">
<p>The collection should be hidden when displayed within an object form.</p>
</div>
</li>
<li>
<p><code>Where.NOWHERE</code><br></p>
<div class="paragraph">
<p>The collection should not be hidden.</p>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>The other values of the <code>Where</code> enum have no meaning for a collection.</p>
</div>
<div class="sect2">
<h3 id="see-also-3"><a class="anchor" href="#see-also-3"></a>See also</h3>
<div class="paragraph">
<p>This attribute can also be applied to:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="Action.html#hidden" class="page">actions</a></p>
</li>
<li>
<p><a href="Property.html#hidden" class="page">properties</a>.</p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="mementoSerialization"><a class="anchor" href="#mementoSerialization"></a><code>mementoSerialization()</code></h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>mementoSerialization</code> attribute indicates that the collection should be included or excluded from any snapshots generated by the <a href="../applib-svc/XmlSnapshotService.html" class="page"><code>XmlSnapshotService</code></a>.</p>
</div>
<div class="paragraph">
<p>For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import lombok.Getter;
import lombok.Setter;
public class Customer {
@Collection(mementoSerialization=EXCLUDED)
@Getter @Setter
private SortedSet&lt;Order&gt; previousOrders = ...
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>Alternatively, if the collection is derived, then providing only a "getter" will also work:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">public class Customer {
public SortedSet&lt;Order&gt; getPreviousOrders() {...}
...
}</code></pre>
</div>
</div>
<div class="sect2">
<h3 id="see-also-4"><a class="anchor" href="#see-also-4"></a>See also</h3>
<div class="paragraph">
<p>This attribute is also supported for <a href="Property.html#mementoSerialization" class="page">properties</a>.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="typeOf"><a class="anchor" href="#typeOf"></a><code>typeOf()</code></h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>typeOf</code> attribute specifies the expected type of an element contained within a collection when for whatever reason the type cannot be inferred from the generic type, or to provide a hint about the actual run-time (as opposed to compile-time) type.</p>
</div>
<div class="paragraph">
<p>For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import lombok.Getter;
public void Customer {
@Collection(typeOf=Order.class)
@Getter
private SortedSet outstandingOrders = ...
}</code></pre>
</div>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>In general we recommend that you use generics instead, eg <code>SortedSet&lt;Order&gt;</code>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="see-also-5"><a class="anchor" href="#see-also-5"></a>See also</h3>
<div class="paragraph">
<p>This attribute can also be specified for <a href="Action.html#typeOf" class="page">actions</a>.</p>
</div>
</div>
</div>
</div>
</article>
<aside class="article-aside toc" role="navigation">
<p class="toc-title">On this page</p>
<div id="article-toc"></div>
</aside>
</main>
</div>
<footer class="footer">
<div class="content">
<div class="copyright">
<p>
Copyright © 2010~2020 The Apache Software Foundation, licensed under the Apache License, v2.0.
<br/>
Apache, the Apache feather logo, Apache Isis, and the Apache Isis project logo are all trademarks of The Apache Software Foundation.
</p>
</div>
<div class="revision">
<p>Revision: SNAPSHOT</p>
</div>
</div>
</footer>
<script src="../../../_/js/site.js"></script>
<script async src="../../../_/js/vendor/highlight.js"></script>
<script src="../../../_/js/vendor/jquery-3.4.1.min.js"></script>
<script src="../../../_/js/vendor/jquery-ui-1.12.1.custom.widget-only.min.js"></script>
<script src="../../../_/js/vendor/jquery.tocify.min.js"></script>
<script>
$(function() {
$("#article-toc").tocify( {
showEffect: "slideDown",
hashGenerator: "pretty",
hideEffect: "slideUp",
selectors: "h2, h3",
scrollTo: 120,
smoothScroll: true,
theme: "jqueryui",
highlightOnScroll: true
} );
});
</script>
</body>
</html>