Class, Method and Property names are always in upper case
-
- Posts: 5
- Joined: Sat 23 Jan 2016 08:09
Class, Method and Property names are always in upper case
Even after changing the settings under Model Settings-->Synchronization-->Model Naming the Class, Method and Property names are always in upper case.
Tried changing all the case settings and it still creates upper case names.
Tried changing all the case settings and it still creates upper case names.
Re: Class, Method and Property names are always in upper case
1. You are using NHibernate Model, aren't you?
2. The Model Settings-->Synchronization-->Model Naming settings are applied to the NEWLY added objects. The names of existing model objects are left unchanged (until you readd them to the model).
3. Specify the test case for reproducing:
a) the name of the database server you are working with
b) the DDL script of a test table/stored procedure
c) your current Model Settings-->Synchronization-->Model Naming settings
d) the names of model objects created by Entity Developer basing on your database objects
2. The Model Settings-->Synchronization-->Model Naming settings are applied to the NEWLY added objects. The names of existing model objects are left unchanged (until you readd them to the model).
3. Specify the test case for reproducing:
a) the name of the database server you are working with
b) the DDL script of a test table/stored procedure
c) your current Model Settings-->Synchronization-->Model Naming settings
d) the names of model objects created by Entity Developer basing on your database objects
-
- Posts: 5
- Joined: Sat 23 Jan 2016 08:09
Re: Class, Method and Property names are always in upper case
Yes I'm using NHibernate Model and creating new model from existing database.
The database is oracle 12c. Below is the DDL of test table
Current Model Naming settings is default i.e. Case: set to "FirstLetterUpperCase" for both Class and Method Names and Class Properties' Names and all other setting are same for both.
Also using the Loquacious Mapping template.
Following is the generated code as is including the filenames..
Test.TPERSON.cs
Test.TPERSON.hbm.xml
Test.TPERSON.LoquaciousMapping.cs
The database is oracle 12c. Below is the DDL of test table
Code: Select all
create table T_Person (
Id number(9) not null,
First_Name VARCHAR(20),
Last_Name VARCHAR(50),
primary key (Id)
)
Also using the Loquacious Mapping template.
Following is the generated code as is including the filenames..
Test.TPERSON.cs
Code: Select all
//------------------------------------------------------------------------------
// This is auto-generated code.
//------------------------------------------------------------------------------
// This code was generated by Entity Developer tool using NHibernate template.
// Code is generated on: 1/26/2016 11:10:00 PM
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Collections.Generic;
namespace Test.Models
{
/// <summary>
/// There are no comments for Test.Models.TPERSON in the schema.
/// </summary>
public partial class TPERSON {
#region Extensibility Method Definitions
/// <summary>
/// There are no comments for OnCreated in the schema.
/// </summary>
partial void OnCreated();
#endregion
/// <summary>
/// There are no comments for TPERSON constructor in the schema.
/// </summary>
public TPERSON()
{
OnCreated();
}
/// <summary>
/// There are no comments for ID in the schema.
/// </summary>
public virtual int ID
{
get;
set;
}
/// <summary>
/// There are no comments for FIRSTNAME in the schema.
/// </summary>
public virtual string FIRSTNAME
{
get;
set;
}
/// <summary>
/// There are no comments for LASTNAME in the schema.
/// </summary>
public virtual string LASTNAME
{
get;
set;
}
}
}
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping schema="TEST" namespace="Test.Models" xmlns="urn:nhibernate-mapping-2.2">
<class name="TPERSON" table="T_PERSON" schema="TEST">
<id name="ID" type="Int32">
<column name="ID" not-null="true" precision="9" scale="0" sql-type="NUMBER" />
<generator class="assigned" />
</id>
<property name="FIRSTNAME" type="String">
<column name="FIRST_NAME" not-null="false" length="20" sql-type="VARCHAR2" />
</property>
<property name="LASTNAME" type="String">
<column name="LAST_NAME" not-null="false" length="50" sql-type="VARCHAR2" />
</property>
</class>
</hibernate-mapping>
Code: Select all
//------------------------------------------------------------------------------
// This is auto-generated code.
//------------------------------------------------------------------------------
// This code was generated by Entity Developer tool using NHibernate Loquacious Mapping template.
// Code is generated on: 1/26/2016 11:10:00 PM
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//------------------------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using NHibernate;
using NHibernate.Mapping.ByCode;
using NHibernate.Mapping.ByCode.Conformist;
namespace Test.Models
{
/// <summary>
/// There are no comments for TPERSONMap in the schema.
/// </summary>
public partial class TPERSONMap : ClassMapping<TPERSON>
{
/// <summary>
/// There are no comments for TPERSONMap constructor in the schema.
/// </summary>
public TPERSONMap()
{
Schema(@"TEST");
Table(@"T_PERSON");
Lazy(true);
Id(x => x.ID, id => {
id.Column(@"ID");
id.Access(Accessor.Property);
id.Type(NHibernateUtil.Int32);
id.Generator(Generators.Assigned);
});
Property(x => x.FIRSTNAME, pm => {
pm.Column(
c => {
c.Name(@"FIRST_NAME");
c.SqlType(@"VARCHAR2");
c.Length(20);
}
);
pm.Access(Accessor.Property);
pm.Type(NHibernateUtil.String);
pm.Generated(PropertyGeneration.Never);
pm.Length(20);
});
Property(x => x.LASTNAME, pm => {
pm.Column(
c => {
c.Name(@"LAST_NAME");
c.SqlType(@"VARCHAR2");
c.Length(50);
}
);
pm.Access(Accessor.Property);
pm.Type(NHibernateUtil.String);
pm.Generated(PropertyGeneration.Never);
pm.Length(50);
});
ExtendMapping();
}
#region Partial Methods
partial void ExtendMapping();
#endregion
}
}
Re: Class, Method and Property names are always in upper case
Upper case is a default case in Oracle, so your script actually creates the following table:ahamBrahmasmi wrote:The database is oracle 12c. Below is the DDL of test tableCode: Select all
create table T_Person ( Id number(9) not null, First_Name VARCHAR(20), Last_Name VARCHAR(50), primary key (Id) )
Code: Select all
create table T_PERSON (
ID number(9) not null,
FIRST_NAME VARCHAR(20),
LAST_NAME VARCHAR(50),
primary key (ID)
)
Code: Select all
create table "T_Person" (
"Id" number(9) not null,
"First_Name" VARCHAR(20),
"Last_Name" VARCHAR(50),
primary key ("Id")
)
-
- Posts: 5
- Joined: Sat 23 Jan 2016 08:09
Re: Class, Method and Property names are always in upper case
Yes..after the table with quoted names is created in the database, i was able to change the naming rules of model and property and it works fine. I tried with all the case options under Model Name settings and it generated as per the configuration.
So it looks like only the case option "FirstLetterUpperCase" in Model Name settings is not working if the table is not created with quoted names then.
So it looks like only the case option "FirstLetterUpperCase" in Model Name settings is not working if the table is not created with quoted names then.
Re: Class, Method and Property names are always in upper case
Refer to http://www.devart.com/entitydeveloper/e ... eloper.chm > ORM Support > Entity Framework > Customizing Model Properties > Synchronization > Model Naming:ahamBrahmasmi wrote:So it looks like only the case option "FirstLetterUpperCase" in Model Name settings is not working if the table is not created with quoted names then.
FirstLetterUppercase
The name of an entity begins with a capital letter, case of other letters will not be changed.
-
- Posts: 5
- Joined: Sat 23 Jan 2016 08:09
Re: Class, Method and Property names are always in upper case
Oops!
Thanks for pointing that out Shalex. Guess I'll rest my case

Thanks for pointing that out Shalex. Guess I'll rest my case
