Ejemplo 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);
        }
Ejemplo n.º 2
0
 public EntityManagerFactory(PersistenceContextConfig config, AssemblyMapping mappings)
 {
     this.config = config;
     this.mappings = mappings;
 }