rvrn22 / nmg Goto Github PK
View Code? Open in Web Editor NEWNHibernate Mapping generator from existing database tables
Home Page: http://www.ranjan.io
License: MIT License
NHibernate Mapping generator from existing database tables
Home Page: http://www.ranjan.io
License: MIT License
I like what you are doing here and clicked on the tutorial link but it returned a 404.
I want to download the binary to run the tool. CodePlex downloads don't work and i can't find one off github.
So i downloaded latest version and tryed generation from PostgreSql and there is a problem, all types from database are mapped to C# type System.String except Boolean ... Its maped to System.Boolean. so its correct.
If i Manually change the value lets say for uuid from System.String to System.Guid its not changed in MapCode or DomainCode and also generated files are still all in String except Boolean value. Boolean is in Domain Code as bool and that is ok, everything else is string and wrong... It seams only MapCode is correct...
Edit: added my preferences image at the bottom
See screenshoots
So manually changing type does noting...
I think MapCode is Ok
You were super fast to close my previous issue, so here there are the right info about the non-working link:
The tutorial link posted in the documentation wiki page is wrong and not accessible anymore
http://www.cubrid.org/wiki_apis/entry/using-nmg-nhibernate-mappings-generator-with-cubrid
should be
http://blog.cubrid.org:8080/wiki_apis/entry/using-nmg-nhibernate-mappings-generator-with-cubrid
Just to let you know,
Thank you
Hello,
I have a problem using this program: I can not connect to my MariaDB database. The database is reachable with other tools, only with this one i can't connect.
I don't know if i do something wrong or if it is a bug.
I have done the following setttings:
Database Type: MySQL
OLE DB Provider: MSDataShape
Server or file name: IpAddress:Port
Location:
Use a specific user name and password: My username and password
If I clilck on "Test Connection" it says "Test conncetion succeded" (But I can write anything into the fields. As long as I leave MSDataShape the Test Connection "works")
The connection string generated:
Provider=MSDataShape.1;Data Source=####.####.#.##:####;User ID=root;Password="#########"
But when I click on "Connect" it gives me the following error in the status bar at the bottom:
Keyword not supported. Parametername: provider
I would be really happy if you could help me.
Alex
PS: If have tried it with the latest compiled release and I have also built the on my one with the code GitHub.
Which translates to "there's no way you're not a boss".
Just that, wanted to say thank you for this project. Couldn't find an email or another way to PM you.
Thank you. Seriously.
e.g. ServiceRelatedRequest table gets generated as Servicerelatedrequest domain class regardless of configurations.
Seems the TextInfo.ToTitleCase method considers the text "ServiceRelatedRequest" as one word and simply converts that to "Servicerelatedrequest".
When receiving the text as "Service_Related_Request" it converts it correctly to ServiceRelatedRequest.
Workaround
I found that the AbstractTextFormatter had a line to add these underscores but was commented out (TextFormatter.cs Line 32). When I uncommented this line it fixed ClassNames but generated property names (which were originally PascalCase) with underscore. Explicity using the "PascalCase" configuration option worked around this.
Foreign Key in MySql DB is determined incorrectly. Using a MUL column from the "describe
" query cannot uniquely identify a column as a foreign key because MUL there means "other than primary single or unique single key". So the generator fails, for example, on any unique multiple indices...If a foreign constraint is defined on a table using a unique key constraint instead of a primary key constraint the model generation is not done properly: consider this structure:
-- Referenced Table (Foreign)
CREATE TABLE [dbo].[MasterTable] (
[IdOfRec] INT NOT NULL,
[NaturalKey] NVARCHAR (20) NOT NULL,
PRIMARY KEY CLUSTERED ([IdOfRec] ASC),
CONSTRAINT [IX_UNIQUE] UNIQUE NONCLUSTERED ([NaturalKey] ASC)
);
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_MasterTable]
ON [dbo].[MasterTable]([NaturalKey] ASC);
-- Referencing Table
CREATE TABLE [dbo].[ReferencingTable] (
[Id] INT NOT NULL,
[ReferentialNaturalKey] NVARCHAR (20) NOT NULL,
[Info] NVARCHAR (50) NOT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_X] FOREIGN KEY ([ReferentialNaturalKey]) REFERENCES [dbo].[MasterTable] ([NaturalKey])
);
The Classes are:
public class MasterTable {
public virtual int IdOfRec { get; set; }
public virtual string Naturalkey { get; set; }
public virtual ICollection<ReferencingTable> Childs { get; set; }
}
public class ReferencingTable {
public virtual int Id { get; set; }
public virtual string ReferentialNaturalKey { get; set; }
public virtual MasterTable master { get; set; }
public virtual string Info { get; set; }
}
When doing model generation , the collection property Childs should have the property-ref attribute in hbm file. It does not so nhibernate cannot map correctly the relation.
Error comes when you create a new connection for connecting with PostgreSQL database and below error comes up -
"only authentication clear text password and authentication md5 password supported for now. received 10"
Hi,
the tutorial link posted in the documentation wiki page:
http://www.cubrid.org/wiki_apis/entry/using-nmg-nhibernate-mappings-generator-with-cubrid
is wrong and not accessible anymore
Thank you
Add class name notation section similar to property names so we can select from Camel, Pascal cases.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.