Db schema is complete, can Entity Framework generate Storage Schema? - entity-framework

If I already have a database schema complete, can the entity framework somehow generate the storage schema for me?
Or if I have the classes developed, can it generate the other xml's desribing the classes and their relationships?

Most can yes... I believe what you would be looking for is hibernate tools (tools.hibernate.com). Toplink and other frameworks should have equivalent functionality. You essentially provide login/db provider information, and it queries the catalog and generates xml and classes

Related

How to create DB Context run time?

In my asp.net core application, each client has their own database schema.
Hence there are many databases. Sometimes the tables and fields will be different.
I have used Entity Framework core as ORM and we are following Generic Repository pattern.
Is there any option to generate DB Context at run time corresponding to each client?
Thanks
Krishnan

Can Entity framework creates tables in other databases?

I am curious to know that if Entity framework can create tables in other databases besides MS-SQL ??
Moreover, is there any provision to create XML schema through EF ?
Under the hood Entity Framework uses providers that are specific for different databases. So it depends on a provider whether EF can create tables or not. However, I haven't heard about providers that do not have this possibility. The easiest way to be sure is to write a simple program with a few lines of code.
As to XML schema. Are you asking about using XML files instead of database as the storage for your data? If so, again it depends on the provider. If you want you can theoretically create one that will use XML files. However, I haven't tried to do so and I don't think that it is a good idea. There are technologies that fit here better (see this question).

Database Crawler using JPA

We have a requirement for building a database crawler. The application parses the tnsnames, connects to each database and retrieves some information like version, accounts, etc. We are trying to use JPA across the other parts of the application and to persist this data into the application's database.
So far, I only see creating an EntityManagerFactory programmatically for every database. Is there any other options?
We are using Spring, are there any benefits that Spring brings to the table in this scenario?
Thanks
JPA is clearly not the right tool for this job. JPA allows creating functional entities mapping a well-know database schema. Your tool doesn't know anything about the schemas and tables it will find. There could be 0 tables or 5000, with completely unknow names.
You need a much lower-level API to do what you want, like JDBC.
You could use JPA to store the results of your crawlings in a single schema, though.

Manually write entities from existing database

We have a very large stablished database (PostgreSQL for the matter) that suffers from standardization and I'd like to use Entity Framework in our future-to-be ASP.NET MVC application.
Is there a way to manually write Entities mappings?
I really don't want to autogenerate Entities based on Database First approach. And I don't have the option, for now, to migrate/update our schema.
Thank you.
Edit: after some more thinking we decided using NHibernate with Fluent NHibernate for the mappings.
We decided to go with NHibernate and Fluent NHibernate for mappings.

Entity Framework and database support

we know that we can generate EDMX model from sql server because EF support sql server. if my database is Oracle,MS-access or MySql then it supports or not. does it support ODBC.
EF is database independent but it requires EF ADO.NET provider to be supplied for the database. You can check the list of databases offering such provider. MS-Access is not among them.
The independence is little bit more theoretical because if you are using EDMX it has always its SSDL part bounded to single provider. If you want to support more databases you must have separate SSDL or whole EDMX for each provider. This is not the problem with EFv4.1 and code-first approach.