Git Product home page Git Product logo

codesmithtools / templates Goto Github PK

View Code? Open in Web Editor NEW
54.0 14.0 35.0 402.39 MB

CodeSmith Generator Templates

Home Page: http://www.codesmithtools.com/product/generator

C# 95.79% Batchfile 0.02% CSS 0.08% PowerShell 0.59% JavaScript 0.04% Visual Basic .NET 3.48% TSQL 0.01%
code-generation codesmith codesmith-templates nhibernate stored-procedures database csla plinqo entity-framework linq-to-sql

templates's People

Contributors

cstbuilds avatar cyberjetx avatar ejsmith avatar fredlackeyofficial avatar niemyjski avatar pwelter34 avatar regbradii avatar shannondavidson avatar tdupont750 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

templates's Issues

MYSQL + NHIBERNATE + CODESMITH

codesmith 5.0.1
mysql v 6 and version 5.x
database layout: northwind db for mysql
failed on: c
1. onnecting to database when used in another project, 
2. classes for employee had many problems and had to be wrote by hand
3. ignored the views
4. ignored the stored procedures

hi there,

seem to have a problem with connectiong to mysql,
i can use the studio fine, and i can follow this video tutorial :

http://www.codesmithtools.com/video/nhibernate.html

and everything builds fine, however once it comes to testing or adding into
a project and testing, nhibernate throws out exceptions with regards to
conneccting to DB:

here is the config
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
        <session-factory>
                <property
name="connection.provider">NHibernate.Connection.DriverConnectionProvider</prope
rty>
                <property
name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
                <property
name="connection.connection_string">Server=localhost;Database=northwind;User 
ID=root;Password=*******;</property>
                <property
name="dialect">NHibernate.Dialect.MySQL5Dialect</property>
                <mapping assembly="codesmith_northwind" />
        </session-factory>
</hibernate-configuration>

and here is the error:

codesmith_northwind.UnitTests.CategoryTests (TestFixtureSetUp):
System.TypeInitializationException : The type initializer for
'NHibernate.Cfg.Environment' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an
instance of an object.codesmith_northwind.UnitTests.CategoryTests
(TestFixtureSetUp):
System.TypeInitializationException : The type initializer for
'NHibernate.Cfg.Environment' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an
instance of an object.

info on error:

at NHibernate.Cfg.Environment.get_Properties()
at NHibernate.Cfg.Configuration.Reset()
at NHibernate.Cfg.Configuration..ctor(SettingsFactory settingsFactory)
at NHibernate.Cfg.Configuration..ctor()
at codesmith_northwind.Base.NHibernateSessionManager..ctor() in
C:\codesmith_northwind\codesmith_northwind\codesmith_northwind\Base\NHibernateSe
ssionManager.cs:line
59
at codesmith_northwind.Base.NHibernateSessionManager.get_Instance() in
C:\codesmith_northwind\codesmith_northwind\codesmith_northwind\Base\NHibernateSe
ssionManager.cs:line
35
at codesmith_northwind.Base.ManagerBase`2..ctor() in
C:\codesmith_northwind\codesmith_northwind\codesmith_northwind\Base\ManagerBase.
cs:line
44
at codesmith_northwind.ManagerObjects.CategoryManager..ctor() in
C:\codesmith_northwind\codesmith_northwind\codesmith_northwind\ManagerObjects\Ca
tegoryManager.Generated.cs:line
21
at codesmith_northwind.ManagerObjects.ManagerFactory.GetCategoryManager()
in
C:\codesmith_northwind\codesmith_northwind\codesmith_northwind\ManagerObjects\Ma
nagerFactory.cs:line
50
at codesmith_northwind.UnitTests.CategoryTests..ctor() in
C:\codesmith_northwind\codesmith_northwind\codesmith_northwind\UnitTests\Categor
yTests.generated.cs:line
18
--NullReferenceException
at NHibernate.Cfg.Environment.LoadGlobalPropertiesFromAppConfig()
at NHibernate.Cfg.Environment..cctor()

you apparently do support mysql, and nhibernate defo supports mysql so can
you help out here, am trying to get into MVC etc.


thanks

dave

p.s please note correction has to be made manually to the stored procedure 
for the database script.

i have included a report from nunit 2.5


Original issue reported on code.google.com by [email protected] on 28 Jan 2009 at 5:55

Attachments:

Entity base class name not reflected in Detach methods where statements.

What steps will reproduce the problem?
1. Change the name of the entity base class from LinqEntityBase (in my 
case EntityBase)
2. Generate the entities
3. Build the project

What is the expected output? What do you see instead?
Build should succeed, but the EntityBase.Generated.cs still had 
LinqEntityBase as the name of the entity base class in the "where 
TEntity : " clause of the Detach methods.

What version of the product are you using?
2.5.1

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 21 Jan 2009 at 10:50

SQL Server User Defined Type problem

What steps will reproduce the problem?
1. In SQL Server 2008 create a user defined data type
2. create a table with a column of defined type
3. use the QuickStart.cst file to generate a quick start application.
4. click on the table to view its details.

What is the expected output? What do you see instead?
I expected to see the details of the table. What I got instead was the 
following error: The specified type '<user defined data type>' is not a 
valid provider type. 


What version of the product are you using?
CodeSmith 5.0.3 revision 575, VS 2008 SP1, SQL Server 2008

Please provide any additional information below.

This issue was previously reported on the codeplex site as Issue #3547, 
dated Feb. 2, 2008.

 am new to CodeSmith so the terminology may be wrong...

I use CodeSmith 4.1, VS2008 RTM and the 2008-01-15 release of PLINQO.

It seams that the dbml.cst template handles user defined SQL types 
incorrectly. The following is from a dbml.cst generated dbml file. The 
Type is set to DateTime but the DbType is set to the user defined SQL type 
LastUpdated.

<Column Name="LastUpdated" Member="LastUpdated" Storage="_lastUpdated" 
Type="DateTime" DbType="LastUpdated NOT NULL" CanBeNull="false" />

The LastUpdate type is defined like this:

CREATE TYPE [dbo].[LastUpdated] FROM [datetime] NULL

When an entity is generated the LastUpdated property will get the 
following attribute:

[Column(Name="LastUpdated", Storage="_lastUpdated", DbType="LastUpdated 
NOT NULL", CanBeNull=false)]

and that will lead to runtime errors (DbType should be DbType="DateTime 
NOT NULL").

A dbml file generated by the default designer (using drag and drop from 
the server explorer) will use the underlying SQL type and look like this:

<Column Name="LastUpdated" Type="System.DateTime" DbType="DateTime NOT 
NULL" CanBeNull="false" />

I think the dbml.cst template must be updated to use the underlying SQL 
type.

Best regards,

Tomas Sondén 

Original issue reported on code.google.com by [email protected] on 6 Dec 2008 at 1:25

PLINQO does not work with with SQL Compact 3.5

As "System.Data.SqlClient" is hardcoded in the files, no support for SQL 
Compact (which supports LINQ to SQL) is available. I have tried to 
generate based on my SQL Compact 3.5 schema provider, but as the templates 
are hardcoded to work only with SqlClient, code generation fails.

Original issue reported on code.google.com by [email protected] on 28 Jan 2009 at 4:41

PLINQO not being able to handle many to many with compsite keys.

What steps will reproduce the problem?

1. Many to many relationship, if there are any foriegn keys that and if 
one of them is they keys in the composite key of the intersection table 
you cannot compile.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using?

v.2.1.500

Please provide any additional information below.

I've attached a full project example of this with the .csp file and a 
backup of the actual 2005 database.

Original issue reported on code.google.com by [email protected] on 30 Jan 2009 at 3:58

PLINQO: Unable to use UTF-8 strings are enum descriptions

What steps will reproduce the problem?
1. Create a Enum table in the database and in the Description column use a 
string that contains non-US-ASCII characters.  In my case I need to use 
Eastern European chars that are part of Latin-2 (ISO/IEC 8859-2) codepage.
2. Generate Dbml and Entities used PLINQO templates
3. Look at DataContext.Enums.cs and notice that the Description attribute 
contains "?" for every non-US-ASCII character in the database Description 
columns

What is the expected output? What do you see instead?
My expectation is that that generated file retains the description text as 
specified in the database including non-US-ASCII chars.  The problem here 
is that the .cs file is not being saved with UTF-8 encoding.

What version of the product are you using?
r496


Original issue reported on code.google.com by [email protected] on 1 Feb 2009 at 7:01

Problem in EntityManager.Generated.cst



What steps will reproduce the problem?
The problem only manifests itself in one scenario for me.  I have a table 
named Provider.  When I generate this table, and its associated managers, 
it gets renamed to ProviderTable because Provider is an internal property 
on DataContext.

What is the expected output? What do you see instead?
If you look at PLINQO\CSharp\Internal\EntityManager.Generated.cst in the 
property for Entity, it uses the following code:
get { return Manager.Context.<%= EntityManager.EntityName %>; }

Since Provider is reserved, my member name is ProviderTable as I mentioned 
above.  I think that this should probably be changed to use the 
EntityManager.PropertyName property instead.


What version of the product are you using?
Checked out the latest files from svn.

Please provide any additional information below.
Like I mentioned above, this only happens with the Provider table.

Original issue reported on code.google.com by likwid on 19 Sep 2008 at 9:06

Plinqo template paths not relative

Plinqo template paths should make themselves relative paths if they are in
the same path as the .csp file.  DbmlFile, OutputDirectory, QueryDirectory.

This may require a CodeSmith change to let the templates know where the
.csp file is located.

Original issue reported on code.google.com by [email protected] on 24 Jan 2009 at 2:13

DB2

What steps will reproduce the problem?
1. I make do connectio with DB2 Database
2. I open schema explorer
3. I open the node of tables
4. When I try to open the node of fields the system response whith this 
error: 
System.Runtime.InteropServices.COMException (0x800A0CC1): O item não pode 
ser encontrado na coleção correspondente ao nome ou ao ordinal solicitado.
   em ADOX.Properties.get_Item(Object Item)
   em SchemaExplorer.ADOXSchemaProvider.GetTableColumns(String 
connectionString, TableSchema table)
   em SchemaExplorer.TableSchema.get_Columns()
   em at.a(Object A_0)

What is the expected output? What do you see instead?


What version of the product are you using?
The version of client and server of DB2 UDB 8.0



Original issue reported on code.google.com by [email protected] on 6 Nov 2008 at 9:56

Attachments:

PLINQO: Table named Model collides with DynamicData.MetaModel property

What steps will reproduce the problem?
1. Create a table named Model
2. Generate

What is the expected output? What do you see instead?
In the DatabaseDataContext.Generated.cs file, there is a property related 
to DynamicData.MetaModel.   This collides with the Model table in our 
database.

#region Model
private static System.Web.DynamicData.MetaModel _model = null;
public static System.Web.DynamicData.MetaModel Model
{
    get
    {
        if (_model == null) 
        {
             _model = new System.Web.DynamicData.MetaModel();
             _model.RegisterContext(typeof(LandingZoneDataContext));
        }
        return _model;
    } 
}
#endregion

This should be named something more unique to differentiate it.


What version of the product are you using?
PLINQO, from SVN


Original issue reported on code.google.com by likwid on 21 Oct 2008 at 10:24

New Feature: Enhanced Attribute Support

New Feature: Enhanced Attribute Support
   a) DataMember - Order
   b) DataContract - IsReference
   c) Association - DeleteRule
      i ) Entities already support DeleteRule.
      ii) DBML needs to be updated.
   d) MemberData – EmitDefaultValue
      i) Set to false on all associative properties.

Original issue reported on code.google.com by [email protected] on 2 Oct 2008 at 9:49

DeepLoad = false Settings return incomplete schema information

This is a weird one.  I am getting different results depending on my method. 

What steps will reproduce the problem?
1. Create a dbo.Customer table (Id, Name)
2. Create a dbo.Lender table (Id, CustomerId, Name)
3. Create a Schema named Test
4. Create a Test.Lender table (Id, CustomerId, Name)
5. Generate

What is the expected output? What do you see instead?
I have played around with this particular issue for awhile, but I get 
different results.  If I generate using the CSharp Dbml template, I get some 
weird stuff in the associations it generates.  For example off of the 
Customer Table I get the following Association:

<Association Name="Customer_Lender" Member="LenderList" 
Storage="_lenderList" ThisKey="Id,Id" OtherKey="CustomerId,CustomerId" 
Type="Lender" />

If I load up the Plinqo.sln file and run the generator, it handles naming 
the associations correctly.

<Association Name="Customer_Lender1" Member="Lender1List" 
Storage="_lender1List" OtherKey="CustomerId" Type="Lender1" />


What version of the product are you using?
Latest from svn

Please provide any additional information below.
I have included the schema for the database that I am experiencing this 
problem with.

The renaming of associations and schema'd objects is an OK solution and one 
that I will use if I have too, but I would like a better way to segregate 
objects via schema.  I realize this is a limitation of LinqToSql right now, 
but I am interested in hearing about any ideas you guys have about solving 
this.


Original issue reported on code.google.com by likwid on 17 Oct 2008 at 11:32

Attachments:

PLINQO: Can we get an identifier preprocessor

What steps will reproduce the problem?
1. Name a column in your database with a preceeding _  (Such as 
_CreateDate)
2. Generate

What is the expected output? What do you see instead?
I would expect to see CreateDate or _CreateDate, but instead I get 
Createdate

What version of the product are you using?
Plinqo - latest from SVN

Please provide any additional information below.

Eric and I talked about adding a preprocess method to identifier 
naming....currently naming is black box.   We have some metadata columns on  
our tables such as (_CreateDate, _EditDate, and _Descriptor).  When I 
generate against a database with these columns, they are generated as 
Createdate.  I would prefer to have some control over how to name certain 
columns, especially if they are known columns like this.

The only way for me to resolve this currently is to override the Generator 
code and recompile the dll which is an unattractive solution for me. 

Original issue reported on code.google.com by likwid on 21 Oct 2008 at 9:08

nHibernate templates- exception in dispose

What steps will reproduce the problem?
1. get a list of from a manager class

What is the expected output? What do you see instead?
An exception is thrown when the Session goes out of scope and finalize is 
called on it.

What version of the product are you using?
5.5.5 6362
nHibernate templates

Please provide any additional information below.

I am using the nHibernate templates.  When the session goes out of scope I 
am getting an exception on iSession.Flush() which is called when finalize 
is being called on the object.

Am I not using the manager class correctly?  Here are the few lines of 
code I am using in a test harness.
When I just get a single line item the exception does not occur.  mapping 
file for line item attached if it helps.
I am following the example from the video.  Wondering if I am just not 
using the manager class correctly.




















static





void Main(string[] args) 
{



try

{





IManagerFactory managerFactory = new ManagerFactory(); 




ILineItemManager lineItemMgr = managerFactory.GetLineItemManager(); 




LineItem li = lineItemMgr.GetById(196288); 




List<LineItem> lineItems = (List<LineItem>)lineItemMgr.GetByEstimateID
(269); 




}





catch (Exception e) 
{





Console.WriteLine(e.ToString()); 
}





finally

{



}





Console 
.ReadLine();








Original issue reported on code.google.com by [email protected] on 28 Jan 2009 at 5:14

Attachments:

Separate out Manager and Test projects from the business entity projects when using NHibernate Template

What steps will reproduce the problem?
1. Generate the NHibernate mapping files and business objects
2.
3.

What is the expected output? What do you see instead?
It is observed that the test classes and the business logic classes are
generated in the same project as that of the business entities and HBM maps.
This is not a good practice since the business entities cannot be shared
with 3rd party applications without sharing the business logic.
There should be a clear line of separation between the Business Logic and
the Business Entity tiers. This rule is not being followed.

There should be an option to allow end users to specify a separate project
location for both the Test classes and the Manager objects.

What version of the product are you using? 5.0.3


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 4 Dec 2008 at 10:59

Many-to-many relationships throw error when serialized

What steps will reproduce the problem?
1. Set the Serialization Mode on the .dbml to Unidirectional.[1]
2. Set the IncludeDataContract option in Entities.cst to true.
3. Generate the entities.
4. Place a [field: NonSerialized] attribute on the public events in the 
entity base class.[2]
5. Attempt to serialize an entity with a many-to-many relationship using 
the DataContractSerializer.

What is the expected output? What do you see instead?
Expected the Entities generator to respect the .dbml Serialization Mode 
setting. Instead, the DataContract and DataMember attributes appear to 
have been placed everywhere.

What version of the product are you using?
Using release 1.3 on Windows Vista.

Please provide any additional information below.
Clara Oscura's article[3] pointed me in this direction.

[1] http://msdn.microsoft.com/en-us/library/bb546184.aspx
[2] 
http://www.netknowledgenow.com/blogs/onmaterialize/archive/2007/03/01/Don_2
700_t-serialize-your-delegates_2100_.aspx
[3] http://geekswithblogs.net/claraoscura/archive/2008/10/10.aspx

Original issue reported on code.google.com by [email protected] on 21 Jan 2009 at 8:54

problem genereating code for NHibernate (legacy database)

What steps will reproduce the problem?
1. follow guide on creating NH's class using codesmith
2. Try generating code


What is the expected output? 
NH related class to be generated

What do you see instead?
Error message:
Rendering output 'NHMaster'...
  Generated: C:\Projects\POC\NHibernateLibrary\HbmMaps\LANGUAGE.hbm.xml
  Generated: 
C:\Projects\POC\NHibernateLibrary\BusinessObjects\LANGUAGE.generated.cs
ERROR: C:\Projects\POC\NHibernateLibrary\NH.csp(0,0) ORA-
00904: "IDX"."TABLE_TYPE": invalid identifier

Stack Trace:
   at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle 
errorHandle, Int32 rc)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle 
statementHandle, CommandBehavior behavior, Boolean needRowid, 
OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle 
statementHandle, CommandBehavior behavior, ArrayList& 
resultParameterOrdinals)
   at System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior 
behavior)
   at SchemaExplorer.OracleSchemaProvider.GetTableIndexes(String 
connectionString, TableSchema table)
   at SchemaExplorer.TableSchema.get_Indexes()
   at NHibernateHelper.TableSearchCriteria.GetIndexSearchCriteria
(Dictionary`2 map)
   at NHibernateHelper.SearchCriteria.GetAllSearchCriteria(TableSchema 
table)
   at _CodeSmith.NHibernateMaster_cst.ManagerObjectTemplate.__RenderMethod1
(TextWriter writer, Control control)
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(OutputFile outputFile, 
Boolean overwrite)
   at _CodeSmith.NHibernateMaster_cst.RenderManagerObjects(TableSchema 
table)
   at _CodeSmith.NHibernateMaster_cst.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Engine.ProjectCodeGenerator.GenerateCode(CodeSmithProject 
csp)
Unable to render output NHMaster, skipping...
Done rendering outputs: 0 succeeded, 1 failed, 0 skipped (1030ms).


What version of the product are you using?
V5.0

Please provide any additional information below.
The legacy tables:

Table name - LANGUAGE
CREATE TABLE LANGUAGE
(
  LANG              VARCHAR2(10 BYTE)           NOT NULL,
  LANG_DESCRIPTION  VARCHAR2(100 BYTE),
  CREATE_DATE       DATE                        DEFAULT 
SYSDATE               NOT NULL,
  CREATE_USER       VARCHAR2(30 BYTE)           DEFAULT 
USER                  NOT NULL,
  MODIFY_DATE       DATE,
  MODIFY_USER       VARCHAR2(30 BYTE)
)
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX LANGUAGE_PK ON LANGUAGE
(LANG)
LOGGING
NOPARALLEL;


CREATE OR REPLACE TRIGGER tr_rq_language
after insert or update or delete
on language
for each row
declare
    l_record_id            number;
    l_trans_id            number;
    l_dml_type            varchar2(10);
begin
    l_dml_type := iif.x(inserting, 'INSERT', iif.x
(updating, 'UPDATE', 'DELETE'));
    if not cc_rpl_elements.remote_operation and not 
cc_rpl_elements.skip_flag then
        -- Get Transaction ID
        l_trans_id := cc_rpl_elements.get_trans_id;
        -- Get Record ID
        select    queue_record_seq.nextval
        into    l_record_id
        from    dual;
        cc_rpl_elements.create_rpl_trans_dtl (
            'LANGUAGE',
            l_dml_type,
            l_record_id);

        if deleting then
            insert into rq_language (
                 lang,
                trans_id,
                record_id)
            values (
                 :old.lang,
                l_trans_id,
                l_record_id);
        else
            insert into rq_language (
                 trans_id,
                 record_id,
                 lang,
                 lang_description,
                 create_date,
                 create_user,
                 modify_date,
                 modify_user)
            values (
                l_trans_id,
                l_record_id,
                :new.lang,
                :new.lang_description,
                :new.create_date,
                :new.create_user,
                :new.modify_date,
                :new.modify_user);
        end if;
    end if;
end;
/
SHOW ERRORS;

ALTER TRIGGER TR_RQ_LANGUAGE DISABLE;



CREATE OR REPLACE TRIGGER TR_BUR_LANGUAGE
before update
on LANGUAGE
for each row
declare
begin
if not cc_rpl_elements.remote_operation then
-- update the Modify User and Date
begin
:new.modify_user :=user;
:new.modify_date := sysdate;
end;
end if;
end;
/
SHOW ERRORS;



ALTER TABLE LANGUAGE ADD (
  CONSTRAINT LANGUAGE_PK
 PRIMARY KEY
 (LANG));


GRANT DELETE ON  LANGUAGE TO DATA_ADMIN;

GRANT INSERT, SELECT, UPDATE ON  LANGUAGE TO DATA_ENTRY;

GRANT SELECT ON  LANGUAGE TO DATA_REPORT;

GRANT SELECT ON  LANGUAGE TO DATA_VIEW;

GRANT DELETE, INSERT, SELECT, UPDATE ON  LANGUAGE TO WEBAGENT;

table - LANGUAGE_TL
CREATE TABLE LANGUAGE_TL
(
  LANG                 VARCHAR2(10 BYTE)        NOT NULL,
  GUI_LANG             VARCHAR2(10 BYTE)        NOT NULL,
  LANG_DESCRIPTION_TL  VARCHAR2(100 BYTE)       NOT NULL,
  ORDER_LIST           NUMBER(2),
  CREATE_DATE          DATE                     DEFAULT 
SYSDATE               NOT NULL,
  CREATE_USER          VARCHAR2(30 BYTE)        DEFAULT 
USER                  NOT NULL,
  MODIFY_DATE          DATE,
  MODIFY_USER          VARCHAR2(30 BYTE)
)
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX LT1_PK ON LANGUAGE_TL
(LANG, GUI_LANG)
LOGGING
NOPARALLEL;


CREATE OR REPLACE TRIGGER tr_rq_language_tl
after insert or update or delete
on language_tl
for each row
declare
    l_record_id            number;
    l_trans_id            number;
    l_dml_type            varchar2(10);
begin
    l_dml_type := iif.x(inserting, 'INSERT', iif.x
(updating, 'UPDATE', 'DELETE'));
    if not cc_rpl_elements.remote_operation and not 
cc_rpl_elements.skip_flag then
        -- Get Transaction ID
        l_trans_id := cc_rpl_elements.get_trans_id;
        -- Get Record ID
        select    queue_record_seq.nextval
        into    l_record_id
        from    dual;
        cc_rpl_elements.create_rpl_trans_dtl (
            'LANGUAGE_TL',
            l_dml_type,
            l_record_id);

        if deleting then
            insert into rq_language_tl (
                 lang,
                 gui_lang,
                trans_id,
                record_id)
            values (
                 :old.lang,
                 :old.gui_lang,
                l_trans_id,
                l_record_id);
        else
            insert into rq_language_tl (
                 trans_id,
                 record_id,
                 lang,
                 gui_lang,
                 lang_description_tl,
                 order_list,
                 create_date,
                 create_user,
                 modify_date,
                 modify_user)
            values (
                l_trans_id,
                l_record_id,
                :new.lang,
                :new.gui_lang,
                :new.lang_description_tl,
                :new.order_list,
                :new.create_date,
                :new.create_user,
                :new.modify_date,
                :new.modify_user);
        end if;
    end if;
end;
/
SHOW ERRORS;

ALTER TRIGGER TR_RQ_LANGUAGE_TL DISABLE;



CREATE OR REPLACE TRIGGER TR_BUR_LANGUAGETL
before update
on LANGUAGE_TL
for each row
declare
begin
if not cc_rpl_elements.remote_operation then
-- update the Modify User and Date
begin
:new.modify_user :=user;
:new.modify_date := sysdate;
end;
end if;
end;
/
SHOW ERRORS;



ALTER TABLE LANGUAGE_TL ADD (
  CONSTRAINT LT1_PK
 PRIMARY KEY
 (LANG, GUI_LANG));


ALTER TABLE LANGUAGE_TL ADD (
  CONSTRAINT LT1_GUI_LANG_FK 
 FOREIGN KEY (GUI_LANG) 
 REFERENCES LANGUAGE (LANG));

ALTER TABLE LANGUAGE_TL ADD (
  CONSTRAINT LT1_LANG_FK 
 FOREIGN KEY (LANG) 
 REFERENCES LANGUAGE (LANG));


GRANT DELETE ON  LANGUAGE_TL TO DATA_ADMIN;

GRANT INSERT, SELECT, UPDATE ON  LANGUAGE_TL TO DATA_ENTRY;

GRANT SELECT ON  LANGUAGE_TL TO DATA_REPORT;

GRANT SELECT ON  LANGUAGE_TL TO DATA_VIEW;

GRANT DELETE, INSERT, SELECT, UPDATE ON  LANGUAGE_TL TO WEBAGENT;



Original issue reported on code.google.com by [email protected] on 28 Jan 2009 at 5:23

nHibernate - Check for Primary Key (Adventure works SQL Server 2008)

Generating project "C:\Users\Blake\Documents\Visual Studio
2008\Projects\ClassLibrary1\ClassLibrary1\CodeSmithProject1.csp" outputs...
Compiling template
"C:\Users\Blake\Documents\CodeSmith\Samples\v5.0\Templates\Frameworks\NHibernate
\CSharp\NHibernateMaster.cst"...
Template compilation succeeded. (131 ms)
Rendering output 'NHibernateMaster'...
  Generated: C:\Users\Blake\Documents\Visual Studio
2008\Projects\ClassLibrary1\ClassLibrary1\HbmMaps\AdventureWorksDWBuildVersion.h
bm.xml
ERROR: C:\Users\Blake\Documents\Visual Studio
2008\Projects\ClassLibrary1\ClassLibrary1\CodeSmithProject1.csp(0,0) Table
"AdventureWorksDWBuildVersion" does not have a primary key.  Please use the
HasPrimaryKey property to check for the existance of a primary key before
accessing the PrimaryKey property.
Stack Trace:
   at SchemaExplorer.TableSchema.get_PrimaryKey()
   at NHibernateHelper.GetBusinessBaseIdType(TableSchema table)
   at
_CodeSmith.NHibernateMaster_cst.BusinessObjectTemplate.__RenderMethod1(TextWrite
r
writer, Control control)
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(OutputFile outputFile,
Boolean overwrite)
   at _CodeSmith.NHibernateMaster_cst.RenderBusinessObjects(TableSchema table)
   at _CodeSmith.NHibernateMaster_cst.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Engine.ProjectCodeGenerator.GenerateCode(CodeSmithProject csp)
Unable to render output NHibernateMaster, skipping...
Done rendering outputs: 0 succeeded, 1 failed, 0 skipped (417ms).

Original issue reported on code.google.com by bniemyjski on 14 Oct 2008 at 3:27

All Stored Procedures are not included from DBML if IncludeFunctions=True

What steps will reproduce the problem?
1. Open generated DBML file
2. Include any Stored Procedure into Methods Pane list
3. Run Generate

What is the expected output? What do you see instead?

Stored Procedure code is not generated and it disappears from the DBML file.
If IncludeFunctions set to True then all stored procedures are included
into generate list...

Please advise if this is bug or we can filter methods only by IgnoreList?

Original issue reported on code.google.com by kachalkov on 1 Feb 2009 at 11:26

PLINQO: When generating using a CSP, individual template file paths are machine specific

What steps will reproduce the problem?
1. Generate using a CSP from inside Visual Studio
2. Change machines and have a different path to files
3. Regenerate

What is the expected output? What do you see instead?
The paths are remembered in the templates as absolute paths.  On my machine 
I use c:\projects, a coworker uses e:\projects.   This template property 
seems to be persisted in the CSP files.   I would prefer this was a 
relative property if possible.

What version of the product are you using?
PLINQO from SVN

Please provide any additional information below.



Original issue reported on code.google.com by likwid on 27 Oct 2008 at 7:21

Feature Request : Visual Studio Like suffix removing for Entity Names

Hi I made my database schema for Linq To Sql Classes and vs2008 Removes
"s","ies -> y" etc. And I have no problem with Vs2008 but when i use PLinqO
with same schema PLinq 1.3.x does not remove s from Entities.
Can you please make it or How can i do it ?

(I know a little cst language)

Original issue reported on code.google.com by [email protected] on 27 Jul 2008 at 7:50

GeneratorSettings being null

What steps will reproduce the problem?
1. Open Dbml.cst
2. Remove the ^sysdiagrams$ regex
3. Try to generate

What is the expected output? What do you see instead?
I expect that an error would not occur =)
Get an ObjectNullReference, when it runs the following code in Dbml.cst:
foreach(string ignore in IgnoreList)
    settings.IgnoreExpressions.Add(new Regex(ignore));

There should be a null check around this.

What version of the product are you using?
The latest from svn

Please provide any additional information below.



Original issue reported on code.google.com by likwid on 2 Oct 2008 at 9:52

There is no Unicode byte order mark. Cannot switch to Unicode.

When I try to edit a dbml file generated by Plinqo using the Visual Studio
designer, I get the following error:

"There is no Unicode byte order mark. Cannot switch to Unicode."

 I've found if I edit the dbml XML myself and change utf-16 to utf-8 in the
xml declaration, the designer works.

I assume this is a bug in the dbml.cst template or perhaps there is a
setting I need to change?

FIX.

You do not have to change the utf-16 to utf-8 for it to work just add a
space after the "utf-16" and before the ?>. Like this.

 <?xml version="1.0" encoding="utf-16" ?>

Original issue reported on code.google.com by bniemyjski on 27 Jun 2008 at 8:41

Nullable DateTime fields are being flagged as broken rule when theit values are null

What steps will reproduce the problem?
1. Create a table (entity) in SQL with a Nullable DateTime field.
2. Get the entity, change any property value other than DateTime field. 
The field should remain null
3. Try to SubmitChanges to database.

What is the expected output? What do you see instead?
The expected output is the entity to be saved with no exceptions since the 
DateTime field is a nullable one. Instead, it throws an exception. Range 
Exception broken rule. The DateTime field should fall between SQL Min Date 
and SQL Max Date. 

Please use labels and text to provide additional information.

        public override void SubmitChanges(ConflictMode failureMode)
        {
            ChangeSet changes = base.GetChangeSet();
            bool isValid = Manager.Rules.Run(changes);

            if (!isValid)
                throw new BrokenRuleException
(Manager.Rules.BrokenRules);

            base.SubmitChanges(failureMode);
        }

It fails right here when is checking for broken rules

Original issue reported on code.google.com by [email protected] on 6 Nov 2008 at 12:03

AllStoredProcedures.cst should not support the TimeStamp datetype

What steps will reproduce the problem?
1. Execute the template against the following schema


/****** Object:  Table [dbo].[ActivityLog]    Script Date: 11/05/2008
13:50:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ActivityLog](
 [RowID] [int] IDENTITY(1,1) NOT NULL,
 [UserGUID] [uniqueidentifier] NOT NULL,
 [ActivityTypeID] [int] NOT NULL,
 [Data] [nvarchar](255) NOT NULL,
 [CreatedDate] [datetime] NOT NULL CONSTRAINT [DF_ActivityLog_CreatedDate]
 DEFAULT (getdate()),
 [UpdatedDate] [datetime] NOT NULL CONSTRAINT [DF_ActivityLog_UpdatedDate]
 DEFAULT (getdate()),
 [RowTimestamp] [timestamp] NOT NULL,
 CONSTRAINT [PK_ActivityLog] PRIMARY KEY CLUSTERED
(
 [RowID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY =
OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

2. Execute generated procedures.

What is the expected output? What do you see instead?
Should not error.

Original issue reported on code.google.com by bniemyjski on 10 Nov 2008 at 3:21

BusinessBase - Id propery not found.

What steps will reproduce the problem?
1. Create an Address table with a primary key of ID 
2. In the hbm file give the name Id
3. Create and run console app and you get an error.

What is the expected output? What do you see instead?
Error: could not resolve property: ID of: 
UdbNhibernate.BusinessObjects.Address

This is in the ConfigureNHibernate method in the PersistanceManager at 
cfg.AddAssembly.

What version of the product are you using?
Codesmith v5 
NHibernate v2 and latest nightly.

Please provide any additional information below.

If I change the property to be ID (and amend the hbm accordingly) it 
works. I think its getting confused over the inherited property in 
BusinessBase.


Original issue reported on code.google.com by [email protected] on 15 Oct 2008 at 10:38

nHibernate - Duplicate Methods, Variables etc..

I've run the nhibernate template (Codesmith v5 with the latest template)
against the AdventureWorks database and discovered a number of bugs..

For business objects the following problems have been found.
1. private member collection variables are duplicated if more than one
foreign key relationship exists for the same table e.g. SalesDetailsHeader
has 2 relationships to Address.
2. private member variables are duplicated for the same reason as 1.
3. public property accessors are duplicated for the same reason as 1.
4. partial methods are duplicated for the same reason as 1.

For generated hbm files.
5. as above for 1 to 4 the corresponding elements are duplicated.

I've found that certainly 1 and 2 are fixed by adding the
MemberColumnSchema.Name to the variable name generated (the same fix may
apply to 3, 4 and 5). I'm still working through the templates but I am
happy to contribute the work I've done once complete.

Ticket: 40506

Original issue reported on code.google.com by bniemyjski on 14 Oct 2008 at 3:21

PLINQO: Problem updating Binary, Image, NText, Text, Xml columns

What steps will reproduce the problem?
1. Add a table with an ntext, text, image, binary or xml column
2. Generate
3. Get the object via a query, change something and try to update calling 
SubmitChanges

What is the expected output? What do you see instead?
I get an exception on SubmitChanges saying that ntext, image, binary, 
etc...cannot be compared.  There needs to be some detection in the 
templates for SqlType to add an argument to the Column attribute at 
generation time.

Sql Server will not allow comparisons for binary data types, so we need to 
add the ability to ignore these columns for updates.

Adding UpdateCheck = UpdateCheck.Never to the [Column...] attribute for 
columns of these types will solve the problem.


What version of the product are you using?


Please provide any additional information below.



Original issue reported on code.google.com by likwid on 13 Nov 2008 at 8:58

PLinqO - include list

In the sample dbml.cst template, there's a property IgnoreList.

Instead of specifying all the tables to ignore, how do I tell it to just
include 2 tables?

Ticket: 40516

Original issue reported on code.google.com by bniemyjski on 14 Oct 2008 at 3:28

Problem with certain IgnoreList expressions

What steps will reproduce the problem?
1. Add "^_+"  , "\$", and "^AspNet_+" to IgnoreList property
2. Try generating

What is the expected output? What do you see instead?
It would not respect my ignore expressions, i still saw the tables show up

What version of the product are you using?
Latest from CVS

Original issue reported on code.google.com by likwid on 2 Oct 2008 at 10:07

PLINQO: Certain column names cause issues when generating Entities

What steps will reproduce the problem?
1. Add three columns to a table (_Descriptor, _CreateDate, _EditDate)
2. Generate Dbml
3. Generate Entities.cst against the generated Dbml

What is the expected output? What do you see instead?

I receive the following error:
System.Collections.Generic.KeyNotFoundException: The given key was not 
present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at 
_CodeSmith.Entities_cst.EntityEditableClass.__RenderMethod1(TextWriter 
writer, Control control) in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Internal
\Entity.Editable.cst:line 67
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Engine.CodeTemplate.RenderToFile(OutputFile outputFile, 
String sourcePath, IMergeStrategy strategy)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(String path, String 
sourcePath, IMergeStrategy strategy)
   at CodeSmith.Engine.CodeTemplate.RenderToFile(String path, 
IMergeStrategy strategy)
   at _CodeSmith.Entities_cst.CreateEntity(EntityGeneratedClass 
entityClass, EntityEditableClass partialClass, Type type) in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Entities
.cst:line 223
   at _CodeSmith.Entities_cst.CreateEntityClasses(Database database) in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Entities
.cst:line 177
   at _CodeSmith.Entities_cst.Generate() in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Entities
.cst:line 83
   at _CodeSmith.Entities_cst.__RenderMethod1(TextWriter writer, Control 
control) in 
e:\Projects\ClickMotiveSVN\ClickMotive.Data\trunk\Templates\CSharp\Entities
.cst:line 242
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at ej.s()

The problem exists in the Entity.Editable.cst template.  I have created an 
svn patch that solves the problem.

What version of the product are you using?
PLINQO, latest from SVN

Original issue reported on code.google.com by likwid on 22 Oct 2008 at 5:01

Attachments:

Functions do not retain custom return types

If I change the return type of a function to one of my entity types and
then re-generate, it will override my custom return type and put it back to
an auto-generated type.

It should preserve my customization and it should also generate the right
code for the function to return the specified entity type.

Original issue reported on code.google.com by [email protected] on 8 Feb 2009 at 9:09

error deleteing detail item. (one to many)

What steps will reproduce the problem?
1. one to many relation, customer and contact
2. set association in contact.gerenate as deleteonnull=true.
2. you code like below
    private void Attach_BasContactsList(BasContacts entity)
        {
            OnPropertyChanging(null);
            entity.BasCustomers = this;
            //OnPropertyChanged(null);  
     //the above line which is comment is not in microsoft's code
        }
3. a form with customer editor, using relation contactlist in bindingsource
and then gridview bind to the bindingsource. delete a line item in 
gridview, then delete another line item again. 
   using datacontext.submitchanges.
   show error and microsoft code is ok.

What is the expected output? What do you see instead?
error when delete two detail line, error says that there are dupliciate 
entity.

What version of the product are you using?
tempalte with codesmith 5.0.1.4983

Please provide any additional information below.


We check the code and find there are two error
1. your template add 1 more line in Attach_BasContactsList and 
Deattach_bascontactlist. Remove it and runs good.
2. your template add isUnique=true in one-many relation, I don't know why, 
but it seems that there is something error inside the csharp code.

Original issue reported on code.google.com by [email protected] on 26 Nov 2008 at 9:34

PLINQO 2.1.500 - ICSharpCode.SharpZipLib System.IO.FileLoadException

What steps will reproduce the problem?
1. Generate project with the version (2.1.500)

What is the expected output? What do you see instead?
A VS solution.

Error after Generate:
System.IO.FileLoadException: Could not load file or 
assembly 'ICSharpCode.SharpZipLib, Version=0.85.4.369, Culture=neutral, 
PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. The located 
assembly's manifest definition does not match the assembly reference. 
(Exception from HRESULT: 0x80131040)
File name: 'ICSharpCode.SharpZipLib, Version=0.85.4.369, Culture=neutral, 
PublicKeyToken=1b03e6acf1164f73'
   at QuickStartUtils.VsProjectCreator.UnzipFileAndRename(String 
zipFileName, String targetDirectory, String[] renameFiles)
   at QuickStartUtils.VsProjectCreator.GetVsProject(PathHelper 
projectPath, String zipFileName)
   at QuickStartUtils.DataProjectCreator.GetFiles(PathHelper projectPath)
   at QuickStartUtils.VsProjectCreator.CreateProject(String projectName, 
SolutionItem[] dependancies)
   at _CodeSmith.QuickStart_cst.CreateQuickStart() in 
c:\Data\Download\Software\CodeSmith\plinqo-v2.1.500\QuickStart.cst:line 57
   at _CodeSmith.QuickStart_cst.__RenderMethod1(TextWriter writer, Control 
control) in c:\Data\Download\Software\CodeSmith\plinqo-v2.1.500
\QuickStart.cst:line 30
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.Control.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Gui.CodeTemplateGenerator.f(Object A_0, EventArgs A_1)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value 
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind 
failure logging.
To turn this feature off, remove the registry value 
[HKLM\Software\Microsoft\Fusion!EnableLog].


What version of the product are you using?
2.1.500 with CodeSmith 5.0.5

Please provide any additional information below.
Works well with PLinqO 2.0


Original issue reported on code.google.com by [email protected] on 27 Jan 2009 at 12:12

nHibernate - minor issue with method generating singular names

The template has a method which is used to ensure the property name is
singular. Problem is that if the column has been given a plural name to
prevent it from clashing with the table name then this causes a compile
time error. The work around is to use the cs_alias extended property and
add 2 s's e.g a ContactDetails column in a ContactDetail table has a
cs_alias of ContactDetailss.

http://community.codesmithtools.com/forums/p/8952/33071.aspx

Original issue reported on code.google.com by bniemyjski on 14 Oct 2008 at 3:31

Keywords collection can not be modified

Hi Tom,

When I open the keywords dialog from the main property window (latest
nightly build), I don't have the ability to add or remove items to the list
of reserved words. The buttons are disabled.

I tried looking for the CSharpKeyWordEscape file so I could perhaps edit
manually but couldn't see this in any of the template directories. Not
entirely sure I'm looking for the right file in the right place though.

Thanks

Original issue reported on code.google.com by [email protected] on 12 Jan 2009 at 9:00

Error using the current version of Plinqo

What steps will reproduce the problem?
1. Generate 
2. When using the software here
3.

What is the expected output? What do you see instead?
No error.


What version of the product are you using?
R372


Please provide any additional information below.
Here is the error:

Here is the code:

        /// <summary>
        /// Initializes a new instance of the <see cref="IFGDataManager"/> 
class.
        /// </summary>
        /// <param name="context">An instance of <see 
cref="IfgLinqdatacontext"/> DataContext.</param>
        public IFGDataManager(IfgLinqdatacontext context) : base(context)
        {
            _accountsPayableAccountManager = new 
AccountsPayableAccountManager(this);

Here is the error:

{"DataServiceKey attribute must specify at least one property 
name.\r\nParameter name: keyNames"}


Original issue reported on code.google.com by [email protected] on 3 Nov 2008 at 10:19

Plinqo Generate on Build

When using the generate on build option with plinqo templates, it will add
a duplicate CodeSmith.Data reference if I have referenced CodeSmith.Data
from a different folder like a Libs folder.


Original issue reported on code.google.com by [email protected] on 24 Jan 2009 at 2:06

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.