Esempio n. 1
0
        public static EntityManagerFactory getFactory(PersistenceContextConfig config)
        {
            AttributeConfigLoader configLoader = new AttributeConfigLoader();

            AssemblyMapping mappings = new AssemblyMapping();

            // convert names to assembly objects
            IEnumerable<Type> persistentTypes = AttributeUtils.GetTypesWithAttribute<Entity>(config.Assemblies);

            foreach (Type type in persistentTypes) {
                mappings.AddMapping (configLoader.createMapping(type));
            }

            return new EntityManagerFactory(config, mappings);
        }
 public EntityManagerFactory(PersistenceContextConfig config, AssemblyMapping mappings)
 {
     this.config = config;
     this.mappings = mappings;
 }