Posts

maven-dependency-plugin (goals “copy-dependencies”, “unpack”) is not supported by m2e

Recently While importing one Maven project into Eclipse(Juno, m2e plug-ins is already installed in Eclipse). I was getting one error in project : maven-dependency-plugin (goals “copy-dependencies”, “unpack”) is not supported by m2e Reason: Eclipse m2e does not support execution, by copying the below code in the build tag resolve the issue. Example: <build> <COPY_CODE_HERE> </build> Code : < pluginManagement > < plugins > <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. --> < plugin > < groupId > org.eclipse.m2e </ groupId > < artifactId > lifecycle-mapping </ artifactId > < version > 1.0.0 </ version > < configuration > < lifecycleMappingMetadata > < pluginExecutions > < pluginExecution > <...

How to upgrade or downgrade data schema ?

Image
I ll continue with this tutorial to show how to upgrade or downgrade the database schema. Suppose we need to add one more field ManagerAddress in our existing Managers tables, To do this we need to use one feature called Migrations . It allows u s to have an ordered set of steps that describe how to upgrade (and downgrade) our database schema. Each of these steps, known as a migration, contains some code that describes the changes to be applied. Tools → NuGet Package Manager → Package Manager Console Run the Enable-Migrations command in Package Manager Console The two new file get created under Migrations folder : Configuration.cs : It contains the setting that Migrations will use for migrating ManagingContext. <timestamp>_InitialCreate.cs  – This is your first migration, it represents the changes that have already been applied to the database to take it from being an empty database to one that includes the Manager and Employee t...

Entity Framework : How to generate model using Entity Framework Design

Image
This is a step-by-step walkthrough which will generate the Model using Entity Framework Designer and then generate a database schema from the model. The model is stored in a an EDMX file Pre-Requisities We need to have Visual Studio 2013 installed to complete this walkthrough.(You can use older version too like 2010 or 2012 to complete this tutorial.) Apart from that, You will also need to have NuGet installed on your Visual Studio. 1. Create new Application Steps : Create new Application Open Visual Studio, Click File → New → Project Click Console Application under templates → Visual C# → Windows Enter Name as ModelFirstApplication and Select OK 2. Create Model To create model, I will use Entity Framework Designer In Solution Explorer , Right Click on your Project and then Add New Item... Select Data from the left menu and then ADO.NET Entity Data Model Enter Name as Managing Context and click OK Now Se...

Entity Framework : How to create code using Existing Database

Image
This is a step-by-step walkthrough which will use existing database to create the model. We will create one console Application which will generate the model using existing databases. Pre-Requisities We need to have Visual Studio 2013 installed to complete this walkthrough.(You can use older version too like 2010 or 2012 to complete this tutorial.) Apart from that, You will also need to have NuGet installed on your Visual Studio and the 6.1 or later of the Entity Framework Tools . 1. Connect to an Existing Database Check here to see how can you connect to existing database. I have already created one database in my previous blog . I ll use the same database( CreateNewDatabase.ManagingContext ) to generate the model. 2. Create the Application Open Visual Studio, Click File → New → Project Click Console Application under templates → Visual C# → Windows Enter Name as CreateModelUsingExistingDatabase and Select OK 3. Reverse ...

How to connect to database using Server Explorer in Visual Studio

Image
Steps to connect to your database using Server Explorer in Visual Studio Open Visual Studio, Select View → Server Explorer Right Click on Data Connections and select Add Connection... If you are not connected to a database from Server Explorer then you will need to select Microsoft Server as the data source. You can connect to either localDb ((localdb)\v11.0) or SQL Express ( ./SQLEXPRESS ), In my case I am connecting to SQLEXPRESS which is hosted my machine(MYNA) so the name will be “ MYNA\SQLEXPRESS ”  and then select your existing database or you can define new database which will get created. Once you are done , You can check the database in the Server Explorer