/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you 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 org.apache.polygene.demo.intro;

import org.apache.polygene.api.entity.EntityBuilder;
import org.apache.polygene.api.entity.EntityComposite;
import org.apache.polygene.api.mixin.Mixins;
import org.apache.polygene.api.property.Property;
import org.apache.polygene.api.unitofwork.UnitOfWork;

public class WhatsAnObjectDocs
{
        // START SNIPPET: wo1
        @Mixins(SomeMixin.class)
        interface MyEntity
                extends Some, Other, EntityComposite
        {}
// END SNIPPET: wo1

        // START SNIPPET: wo2
        interface SomeState
        {
            Property<String> someProperty();
        }
// END SNIPPET: wo2

        // START SNIPPET: wo3
        interface MyState
                extends SomeState, OtherState //, ...
        {}
// END SNIPPET: wo3


        abstract class SomeMixin implements Some
        {}

        interface Some
        {}

        interface Other
        {}

        interface OtherState
        {}

        {

            UnitOfWork uow = null;
// START SNIPPET: wo4
            EntityBuilder<MyEntity> builder = uow.newEntityBuilder(MyEntity.class);
            MyState state = builder.instanceFor(MyState.class);

            //... init state ...

            MyEntity instance = builder.newInstance();
// END SNIPPET: wo4        }


        }

    }

@@ -948,30 +948,28 @@
 api.
+id
 entity.
-EntityComposite
+HasIdentity
 ;%0Aim
@@ -1195,16 +1195,17 @@
 @Mixins(
+ 
 SomeMixi
@@ -1211,16 +1211,17 @@
 in.class
+ 
 )%0A      
@@ -1240,32 +1240,16 @@
 MyEntity
-%0A               
  extends
@@ -1266,23 +1266,22 @@
 er, 
-EntityComposite
+HasIdentity %7B%7D
 %0A   
@@ -1277,35 +1277,32 @@
 tity %7B%7D%0A        
-%7B%7D%0A
 // END SNIPPET: 
@@ -1429,16 +1429,24 @@
       %7D%0A
+        
 // END S
@@ -1517,24 +1517,8 @@
 tate
-%0A               
  ext
@@ -1563,16 +1563,24 @@
      %7B%7D%0A
+        
 // END S
@@ -1776,17 +1776,16 @@
       %7B%0A
-%0A
         
@@ -1811,16 +1811,28 @@
 = null;%0A
+            
 // START
@@ -2083,16 +2083,28 @@
 ance();%0A
+            
 // END S
@@ -2114,27 +2114,16 @@
 PET: wo4
-        %7D%0A%0A
 %0A       

:tutorials:whats-an-object refine snippets