Examples of MetaDataBuilder


Examples of com.impetus.kundera.metadata.MetadataBuilder

 
  @SuppressWarnings("rawtypes")
  private static void loadDynamicClassIntoKundera(String persistenceUnit, Class<?> clazz, Map config) {
    // Add the metadata by hand to all the right places
    // 0] Create the metadata:
    MetadataBuilder kunderaBuilder = new MetadataBuilder(persistenceUnit, (String) config.get("kundera.nodes"), config);
    EntityMetadata myMeta = kunderaBuilder.buildEntityMetadata(clazz);
    // 1] class -> persitence unit:
    Map<String, List<String>> clazzHack = new HashMap<String, List<String>>();
    clazzHack.put(clazz.getName(), Arrays.asList(persistenceUnit));
    KunderaMetadata.INSTANCE.getApplicationMetadata().setClazzToPuMap(clazzHack);
    // 2] PU -> class:
View Full Code Here

Examples of com.impetus.kundera.metadata.MetadataBuilder

        Map<String, PersistenceUnitMetadata> metadataCol = new HashMap<String, PersistenceUnitMetadata>();

        metadataCol.put(persistenceUnit, puMetadata);
        appMetadata.addPersistenceUnitMetadata(metadataCol);

        MetadataBuilder metadataBuilder = new MetadataBuilder(persistenceUnit, CoreTestClient.class.getSimpleName(),
                null, kunderaMetadata);
        metadataBuilder.buildEntityMetadata(metadata.getEntityClazz());

        // Named query asserts.
        Assert.assertNotNull(appMetadata.getQuery("test.named.query"));
        Assert.assertEquals(appMetadata.getQuery("test.named.query"), named_query);
        Assert.assertNotNull(appMetadata.getQuery("test.named.queries1"));
View Full Code Here

Examples of com.impetus.kundera.metadata.MetadataBuilder

                        // double check locking.
                        synchronized (clazz)
                        {
                            if (null == metadata)
                            {
                                MetadataBuilder metadataBuilder = new MetadataBuilder(persistenceUnit, client,
                                        KunderaCoreUtils.getExternalProperties(persistenceUnit, externalPropertyMap,
                                                persistenceUnits), kunderaMetadata);
                                metadata = metadataBuilder.buildEntityMetadata(clazz);

                                // in case entity's pu does not belong to parse
                                // persistence unit, it will be null.
                                if (metadata != null)
                                {
View Full Code Here

Examples of com.volantis.mcs.policies.variants.metadata.MetaDataBuilder

                // appropriate type unless the data is read only or the variant
                // type precludes this.
                Proxy typeProxy = selectedVariant.getPropertyProxy(PolicyModel.VARIANT_TYPE);
                if (metadataProxy == null && !metadataBase.isReadOnly() &&
                        typeProxy.getModelObject() != VariantType.NULL) {
                    MetaDataBuilder metaDataBuilder = getDefaultMetaDataBuilder();
                    metadataBase.setModelObject(metaDataBuilder);

                    // Now that we've set a concrete model object, we should
                    // have a concrete proxy.
                    metadataProxy = (BeanProxy) metadataBase.getConcreteProxy();
View Full Code Here

Examples of com.volantis.mcs.policies.variants.metadata.MetaDataBuilder

     * @todo better There must be some way of doing this automatically (and if not, there should be).
     * @return An empty instance of the default metadata type for this policy,
     *         or null if one could not be created
     */
    private MetaDataBuilder getDefaultMetaDataBuilder() {
        MetaDataBuilder metaDataBuilder = null;
        PolicyType policyType = context.getPolicyType();
        if (policyType == VariablePolicyType.TEXT) {
            metaDataBuilder = POLICY_FACTORY.createTextMetaDataBuilder();
        } else if (policyType == VariablePolicyType.CHART) {
            metaDataBuilder = POLICY_FACTORY.createChartMetaDataBuilder();
View Full Code Here

Examples of org.exoplatform.container.management.MetaDataBuilder

    * @param clazz the clazz
    * @throws IllegalArgumentException if the class is null or does not contain meta data
    */
   public ExoMBeanInfoBuilder(Class clazz) throws IllegalArgumentException
   {
      this.typeMD = new MetaDataBuilder(clazz).build();
   }
View Full Code Here

Examples of org.exoplatform.container.management.MetaDataBuilder

    * @param clazz the clazz
    * @throws IllegalArgumentException if the class is null or does not contain meta data
    */
   public ExoMBeanInfoBuilder(Class clazz) throws IllegalArgumentException
   {
      this.typeMD = new MetaDataBuilder(clazz).build();
   }
View Full Code Here

Examples of org.exoplatform.container.management.MetaDataBuilder

    * @param clazz the clazz
    * @throws IllegalArgumentException if the class is null or does not contain meta data
    */
   public ExoMBeanInfoBuilder(Class clazz) throws IllegalArgumentException
   {
      this.metaDataBuilder = new MetaDataBuilder(clazz);
   }
View Full Code Here

Examples of org.exoplatform.container.management.MetaDataBuilder

      return methodMap;
   }

   public void testImpact()
   {
      MetaDataBuilder builder = new MetaDataBuilder(Foo.class);
      ManagedTypeMetaData type = builder.build();
      Map<String, ManagedMethodMetaData> methodMap = getMethodMap(type);
      ManagedMethodMetaData read = methodMap.get("read");
      assertEquals(ImpactType.READ, read.getImpact());
      ManagedMethodMetaData write = methodMap.get("write");
      assertEquals(ImpactType.WRITE, write.getImpact());
View Full Code Here

Examples of org.exoplatform.container.management.MetaDataBuilder

      assertEquals(ImpactType.IDEMPOTENT_WRITE, idempotentWrite.getImpact());
   }

   public void testMethodNameOverride()
   {
      MetaDataBuilder builder = new MetaDataBuilder(Bar.class);
      try
      {
         builder.build();
         fail();
      }
      catch (IllegalArgumentException expected)
      {
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.