Any new release plan?
Is there any release plan for the next version of the ibatis for .NET ?
Re: Next Release
For me: 1) for 1.6.2 beta, I'd like to see a GA version with JIRA checked if there's any bug for it. 2) an new version with 1.6.x with QueryForDataTable, Castle.DynamicProxy2 is a bouns but not a must. 3) I don't mind the breaking changes currently in V3. ISqlMapper is designed to be singleton-per-thread in 1.6.x, the 3.x code in repository addresses this issue and provides a more flexible connection management model. It will be better to keep these broken changes and I think it is easy to add a wrapper that acts as ISqlMapper in 1.6.x. 4) I think the IMapperFactory interface in V3 can be discarded for some reasons: a) to keep the simplicity of iBATIS.NET b) Visual Studio provides powerful DSL tools. IMapperFactory can be easily complished with generative programming by user rather than in iBATIS.NET. 5) NUnit 2.5 enables generic test, it will simplifies writing tests for testing iBATIS on different database. Yaojian On Mon, Jun 22, 2009 at 9:28 PM, Michael McCurrey mmccur...@gmail.comwrote: Ok folks, I'd like to plan the next release of iBatis and would like to know What do you want? I would like to make a few small releases to bridge the 1.X line the existing 3.X line due to the number of breaking changes in the 3.X line. Some things I want to do for 'just me' are: 1. Feature match the Java version 2. Fix an annoying list non lazy load bug 3. Rev to my Castle.DynamicProxy2 patch 4. Expose a QueryForDataTable 5. Drop .net 1.X compatibility. 6. Lastly, I would like something ambitious like Orin's Binsor for Castle on the configuration front. -- Michael
Re: Oracle Return SYS_REFCURSOR Issue
I have used oracle in serveral years but not with iBATIS. The GetWidgets function has a return parameter. As Oracle support function overloads, it can not find a function named as GetWidgets with no parameter. I guess you should define a parameterMap. You may also try the ODBC call syntax. On Thu, Jun 11, 2009 at 3:02 AM, Uwe Schmitz uwe.schm...@protegra.comwrote: I have the following package in an Oracle 9i Database Release 2; I’m using the Oracle Data Provider 11.1.0.6.20 and iBATIS DataMapper 1.6.1. Calling ISqlMapper.QueryForListWidget(GetWidgets, null) produces the following error: ORA-06550: line 1, column 7: PLS-00221: 'GET_WIDGETS' is not a procedure or is undefined ORA-06550: line 1, column 7: PL/SQL: Statement ignored A Google search reveals several articles about getting the Java DataMapper to work like this; the FAQ even features an article about using a REF CURSOR as an output parameter. No solution to this approach seems to be available. Any assistance getting this to work with would be appreciated. *Package Specification* Package WIDGETS_PKG As Function GET_WIDGETS Return SYS_REFCURSOR; End WIDGETS_PKG; *Package Body* Package Body WIDGETS_PKG As Function GET_WIDGETS Return SYS_REFCURSOR Is WIDGETS SYS_REFCURSOR; Begin Open WIDGETS For SELECT ID, NAME FROM WIDGETS ORDER BY ID; Return WIDGETS; End; End WIDGETS_PKG; *Widget Class* namespace Testing { public class Widget { public int Key { get; set; } public string Name { get; set; } } } *Data Map* ?xml version=1.0 encoding=utf-8 ? sqlMap namespace=Widget xmlns=http://ibatis.apache.org/mapping; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; alias typeAlias alias=Widget type=Testing.Widget, Testing / /alias statements procedure id=GetWidgets resultMap=GetWidgetsResultMapWIDGETS_PKG.GET_WIDGETS/ procedure /statements resultMaps resultMap id=GetWidgetsResultMap class=Widget result property=Key column=ID / result property=Name column=NAME / /resultMap /resultMaps /sqlMap
Re: Castle.DynamicProxy2
Still not a committer? On Wed, Jun 10, 2009 at 11:05 PM, Michael McCurrey mmccur...@gmail.comwrote: So, I had some spare time last night and wanted to see how difficult it would be to port iBatisNet 1.6.2 to use Castle.DynamicProxy2 instead of Castle.DynamicProxy. I needed this for my own purposes as I don't like having to cart around both dlls. I managed to port it and in addition remove the CachedProxyGenerator class ( and a couple others) because DynamicProxy2 seems to do its own TypeCaching. It works and all the nunit tests pass. I haven't done any timing tests yet to test performance. It seems DynamicProxy2 comes with a partner dll called Castle.Core which I think could be ILmerged in. Is anybody interested in this? If so, I don't have committer status yet and could forward the changeset to somebody else that does.
Re: mapper instance on http session
There is no need to hold ISqlMapper/SqlMapper in http session. The configuration is loaded only once in DomSqlMapBuilder.Configure(). On Fri, Jun 5, 2009 at 2:42 PM, Edu eduardo.guardi...@gmail.com wrote: Hello, i'm wondering if it is convenient to hold an mapper instance in the asp.net http session. is ibatis reloading and reading again configuration files each page reload, by example ? sorry my english.
Re: [NOMINATION/VOTE] New iBATIS.NET Committer Team Members
Great ! On Tue, Jun 2, 2009 at 11:18 PM, Clinton Begin clinton.be...@gmail.comwrote: Hi all, Based on these votes, I'm going to propose to the iBATIS PMC that the following two committers join Michael Schall and Ron Grabowski as committers on the Apache iBATIS.NET project. * Michael McCurrey * Sal Bass The next steps for these two are: * File an ICLA * I'll raise the vote on the iBATIS PMC list right now (a required formality, but I can't see it failing) As soon as both are done, I can create accounts. NOTE: If you did not make it, then don't give up! We want to create the team that can continue to build the team. Keep contributing and working with these two guys, and I'm sure you'll be next in line. Cheers, Clinton On Mon, Jun 1, 2009 at 1:16 PM, Michael McCurrey mmccur...@gmail.comwrote: I think Clinton was going to tally it up. On Mon, Jun 1, 2009 at 12:13 PM, Yaojian sky...@gmail.com wrote: Any progress? -- Michael J. McCurrey Read with me at http://www.mccurrey.com
Re: IBATIS.NET - V3- Gets the IDataMapper from an IMapperFactory looks very strange
I guess the original idea is allow a user to customize the IDataMapper implementation class. But the DefaultConfigurationEngine instantiate the DataMapper instance in a non-virtual method. If we can add a DataMapperClass property in the ConfigurationSetting class, such as the ConfigurationSetting.SessionFactory does, we can make this work. By the way, I wrote some notes about the V3 configuration process: http://sites.google.com/site/ibatisnetinside/Home/DataMapperConfiguring On Mon, Jun 1, 2009 at 7:24 PM, Michael McCurrey mmccur...@gmail.comwrote: I have no clue. I'm still wresting with with large scale changes between 1 and 3. On Mon, Jun 1, 2009 at 1:19 AM, Yaojian sky...@gmail.com wrote: The Apache.Ibatis.DataMapper.DefaultMapperFactory does not implement the IMapperFactory.GetMapperTInterface(); so the only way AFAIK to get the IDataMapper is to use a type cast as: IMapperFactory mapperFactory = configurationEngine.BuildMapperFactory(); IDataMapper dataMapper = ((IDataMapperAccessor)mapperFactory).DataMapper; //since GetInterfaceT has not been implemented. Any one have idea about what the GetInterfaceT intend to be? -- Michael J. McCurrey Read with me at http://www.mccurrey.com
Re: [NOMINATION/VOTE] New iBATIS.NET Committer Team Members
Any progress?
Re: IBATIS.NET - V3- Gets the IDataMapper from an IMapperFactory looks very strange
After reading http://opensource.atlassian.com/confluence/oss/display/IBATIS/iBATIS+3.0+Whiteboard and the iBATIS v3 java code, I think: MapperFactory.GetMapperT is intended to create proxies of Mapper interfaces. A mapper interface is a interface that defines data access methods for a specific data object type. Such as: public interface ICustomerMapper { IListCustomer FindByName(String name); } The implementation of GetMapperICustomerMapper will create a dynamic proxy that implements FindByName as to invoke IDataMapper.Select(ICustomer-FindByName, new Hashtable(name, nameValue)). The ICustomer-FindByName may be defined as something like: select id=ICustomerMapper-FindByName parameterClass=Hashtable/select On Mon, Jun 1, 2009 at 11:02 PM, Yaojian sky...@gmail.com wrote: Another for session: http://sites.google.com/site/ibatisnetinside/Home/session-management Error correction is warmly welcome. On Mon, Jun 1, 2009 at 8:47 PM, Michael McCurrey mmccur...@gmail.comwrote: AWESOME On Mon, Jun 1, 2009 at 5:08 AM, Yaojian sky...@gmail.com wrote: I guess the original idea is allow a user to customize the IDataMapper implementation class. But the DefaultConfigurationEngine instantiate the DataMapper instance in a non-virtual method. If we can add a DataMapperClass property in the ConfigurationSetting class, such as the ConfigurationSetting.SessionFactory does, we can make this work. By the way, I wrote some notes about the V3 configuration process: http://sites.google.com/site/ibatisnetinside/Home/DataMapperConfiguring On Mon, Jun 1, 2009 at 7:24 PM, Michael McCurrey mmccur...@gmail.comwrote: I have no clue. I'm still wresting with with large scale changes between 1 and 3. On Mon, Jun 1, 2009 at 1:19 AM, Yaojian sky...@gmail.com wrote: The Apache.Ibatis.DataMapper.DefaultMapperFactory does not implement the IMapperFactory.GetMapperTInterface(); so the only way AFAIK to get the IDataMapper is to use a type cast as: IMapperFactory mapperFactory = configurationEngine.BuildMapperFactory(); IDataMapper dataMapper = ((IDataMapperAccessor)mapperFactory).DataMapper; //since GetInterfaceT has not been implemented. Any one have idea about what the GetInterfaceT intend to be? -- Michael J. McCurrey Read with me at http://www.mccurrey.com -- Michael J. McCurrey Read with me at http://www.mccurrey.com
Re: Dirty Tracking Issue
I have a new solution based on a custom ISetAccessor rather than the IObjectFactory. As the IBatisNet use ISetAccessor to set the value of a property, we can use a custom ISetAccessor saves the IsDirty state before actually set the property value and restore it later. I attach the unit test. Hope it works for you. On Fri, May 29, 2009 at 11:45 PM, Sal Bass salbass...@hotmail.com wrote: I am using auto properties. I have toyed with ibatis constructor loading, but because I have never used it on a production app with Ibatis I have been hesitant. I may have to resort to using standard properties and go with Yaojin's solution, or your constructor solution. I have been trying to avoid both of these but there is no other waythat I can think of. Date: Fri, 29 May 2009 08:35:46 -0700 Subject: Re: Dirty Tracking Issue From: mmccur...@gmail.com To: user-cs@ibatis.apache.org Are you in a situation where you can't use constructor loading of your objects? If your not using auto-properties (which it seems your not), this might solve your problem entirely. On Fri, May 29, 2009 at 8:32 AM, Yaojian wrote: That is my mistake, the nested objects loaded from the database is not touched so they remains its dirty state set by AOP. I think the simplest solution is to map a column to a field instead of a property. for example, a C# property: private string m_Name; public String Name { get { return m_Name; } set { m_Name = value; } } we can map the column Name to the m_Name field rather than the Name property in SqlMap: So load object from DB will not fire the dirty tracking injiected by AOP. On Fri, May 29, 2009 at 9:19 PM, Sal Bass wrote: Yaojian, Thanks! I am still confused though. When I make a call to QueryForObject and reset the IsLoading flag to false, that only sets it false for the root object. All complex property collections that are loaded at the same time will not be reset. Am I missing something obvious? Date: Fri, 29 May 2009 03:52:58 +0800 Subject: Re: Dirty Tracking Issue From: sky...@gmail.com To: user-cs@ibatis.apache.org If the non-root object is loaded from the database, it should be created with the new object factory. otherwise, it is irrelavant with 'dirty'. Bellow is my code for using IObjectFactory, I use a custom IObjectFactory for attaching each object to a context variable. DomSqlMapBuilder builder = CreateDomSqlMapBuilder(); //Use SqmObjectFactory for attaching objects to the current IObjectContext IObjectFactory originalFactory = new ObjectFactory(true); SqmObjectFactory contextableFactory = new SqmObjectFactory(originalFactory); builder.ObjectFactory = contextableFactory; ISqlMapper sqlMapper = builder.Configure(m_SqlMapDocument); -- /// Represents the factory of MDA persistent object used by IBatis.NET. /// attaches an /// to each objects created with this factory. public class SqmObjectFactory : IObjectFactory, IEntityContextBindable { /// Creates an instance. /// The original . public SqmObjectFactory(IObjectFactory objectFactoryImpl) { if (objectFactoryImpl == null) throw new ArgumentNullException(objectFactoryImpl); m_ObjectFactoryImpl = objectFactoryImpl; } private readonly IObjectFactory m_ObjectFactoryImpl; private IEntityContext m_EntityContext; public IEntityContext EntityContext { get { return m_EntityContext; } set { m_EntityContext = value; } } /// . public IFactory CreateFactory(Type typeToCreate, Type[] types) { IFactory result = m_ObjectFactoryImpl.CreateFactory(typeToCreate, types); if (typeof(IEntityContextBindable).IsAssignableFrom(typeToCreate)) { return new SqmFactory(this, result); } return result; } private class SqmFactory : IFactory { public SqmFactory(IEntityContextBindable objectContextable, IFactory factory) { if (objectContextable == null) throw new ArgumentNullException(objectContextable); if (factory == null) throw new ArgumentNullException(factory); m_ObjectContextable = objectContextable; m_Factory = factory; } private readonly IEntityContextBindable m_ObjectContextable; private readonly IFactory m_Factory; public object CreateInstance(object[] parameters) { Object result = m_Factory.CreateInstance(parameters); ((IEntityContextBindable)result).EntityContext = m_ObjectContextable.EntityContext; return result; } } } On Fri, May 29, 2009 at 3
Re: Dirty Tracking Issue
sorry I attached the wrong mapping file :-( On Sat, May 30, 2009 at 12:29 AM, Yaojian sky...@gmail.com wrote: Yes, the constructor is better in simplicity, and is slightly better in performance if it is public :-) If you wanna to use the constructor solution, note that all auto-properties must be replaced by a normal property with a backend field. for example: public String Name { get; set; } must be replaces with a normal property like: private String m_Name; public String Name { get { return m_Name;} set { m_Name = value;}} and the constructor should set the value to the m_Name field instead of the property. On Sat, May 30, 2009 at 12:21 AM, Michael McCurrey mmccur...@gmail.comwrote: Constructor loading is simple and no magic required. make sure your using the 1.6.2 source if your using maps that extend maps in your contructor you can then specific Isdirty = false as the last line; On Fri, May 29, 2009 at 8:45 AM, Sal Bass salbass...@hotmail.com wrote: I am using auto properties. I have toyed with ibatis constructor loading, but because I have never used it on a production app with Ibatis I have been hesitant. I may have to resort to using standard properties and go with Yaojin's solution, or your constructor solution. I have been trying to avoid both of these but there is no other waythat I can think of. Date: Fri, 29 May 2009 08:35:46 -0700 Subject: Re: Dirty Tracking Issue From: mmccur...@gmail.com To: user-cs@ibatis.apache.org Are you in a situation where you can't use constructor loading of your objects? If your not using auto-properties (which it seems your not), this might solve your problem entirely. On Fri, May 29, 2009 at 8:32 AM, Yaojian wrote: That is my mistake, the nested objects loaded from the database is not touched so they remains its dirty state set by AOP. I think the simplest solution is to map a column to a field instead of a property. for example, a C# property: private string m_Name; public String Name { get { return m_Name; } set { m_Name = value; } } we can map the column Name to the m_Name field rather than the Name property in SqlMap: So load object from DB will not fire the dirty tracking injiected by AOP. On Fri, May 29, 2009 at 9:19 PM, Sal Bass wrote: Yaojian, Thanks! I am still confused though. When I make a call to QueryForObject and reset the IsLoading flag to false, that only sets it false for the root object. All complex property collections that are loaded at the same time will not be reset. Am I missing something obvious? Date: Fri, 29 May 2009 03:52:58 +0800 Subject: Re: Dirty Tracking Issue From: sky...@gmail.com To: user-cs@ibatis.apache.org If the non-root object is loaded from the database, it should be created with the new object factory. otherwise, it is irrelavant with 'dirty'. Bellow is my code for using IObjectFactory, I use a custom IObjectFactory for attaching each object to a context variable. DomSqlMapBuilder builder = CreateDomSqlMapBuilder(); //Use SqmObjectFactory for attaching objects to the current IObjectContext IObjectFactory originalFactory = new ObjectFactory(true); SqmObjectFactory contextableFactory = new SqmObjectFactory(originalFactory); builder.ObjectFactory = contextableFactory; ISqlMapper sqlMapper = builder.Configure(m_SqlMapDocument); -- /// Represents the factory of MDA persistent object used by IBatis.NET. /// attaches an /// to each objects created with this factory. public class SqmObjectFactory : IObjectFactory, IEntityContextBindable { /// Creates an instance. /// The original . public SqmObjectFactory(IObjectFactory objectFactoryImpl) { if (objectFactoryImpl == null) throw new ArgumentNullException(objectFactoryImpl); m_ObjectFactoryImpl = objectFactoryImpl; } private readonly IObjectFactory m_ObjectFactoryImpl; private IEntityContext m_EntityContext; public IEntityContext EntityContext { get { return m_EntityContext; } set { m_EntityContext = value; } } /// . public IFactory CreateFactory(Type typeToCreate, Type[] types) { IFactory result = m_ObjectFactoryImpl.CreateFactory(typeToCreate, types); if (typeof(IEntityContextBindable).IsAssignableFrom(typeToCreate)) { return new SqmFactory(this, result); } return result; } private class SqmFactory : IFactory { public SqmFactory(IEntityContextBindable objectContextable, IFactory factory) { if (objectContextable
Re: Ibatis.Net - A Call to Arms
I think the 1.6.2 beta version is quite stable, make it GA as soon as posible is a signal that indicates the project is still active. Since someone in this user group said he uses V3 release in a production enviorment and it works fine, I suggest to public the current V3 branch with some document, espically the changes from V1.x, will get more testers for V3. iBatis.NET is a great software. It's happy to see the hope of moving on again. Yaojian On Thu, May 28, 2009 at 9:03 PM, Nicholas L. Piasecki nicho...@piasecki.name wrote: As a long time user of iBATIS.NET, I pretty much agree with everything that Rob has said here--though as a user of Castle NVelocity, I would recommend not touching that particular project with a 64-foot pole; I would be concerned with iBATIS.NET acquiring that dependency if it hasn't already. It's a great templating language, but the implementation is not healthy. I also imagine that it would limit iBATIS.NET's evolution options in the future, such as precluding the ability to pre-generate code files instead of inspecting an XML configuration at start up. As iBATIS.NET evolves, it would be nice if it continued to grow into the .NET idioms as Rob has enumerated here--things like enrolling in System.Transaction, using the built-in connectionStrings in the app.config configuration, heck, even using the standard configuration classes at all. This would at least help to eliminate the necessity of providers.config, which has always seemed a bit odd to me. My only real hangup is that it'd be nice if these major feature changes occurred in a branch that obviously contains breaking changes--e.g., 3.0--and not munging them together with existing maintenance 2.x branch. (The Castle project, MonoRail especially, has been in Release Candidate mode for seemingly its entire life, and the only way to get important bug fixes is to track the trunk and upgrade along with all of its new features, which is insane.) My two cents. My thanks to the community for all the hard work! V/R, Nicholas Piasecki Software Developer Skiviez, Inc. n...@skiviez.com 804-550-9406
Re: Dirty Tracking Issue
We can bypass to set 'dirty' if the AOP generation mechanism can know an object is in 'loading' state. We can use a custom IBatisNet.Common.Utilities.IObjectFactory to mark an object 'loading'. And we can use a wrapped ISqlMapper to clean the 'loading' flag as: public object QueryForObject(string statementName, object parameterObject) { Object result = originalSqlMapper.QueryForObject(...); result.IsLoading = false; return result; } Yaojian On Fri, May 29, 2009 at 1:55 AM, Sal Bass salbass...@hotmail.com wrote: I am having a dilema with implementing dirty tracking on my entities. I am using AOP to mark an entity as dirty when a property is set. The problem occurs when I load the entities using Ibatis because it sets the properties during mapping which makes the entity dirty (no, I can't use constructor mapping here). So, I use a RowDelegate to mark the entity clean before returning it. Works greatexcept for when I am loading a root object with several complex properties (ILists of other entities). The RowDelegate is obviously not fired for each complex property, so they are returned as dirty. Any idea of how I can get at all of the complex properties to mark them clean before returning the entity? _ Hotmail® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009
Re: Using nested classes with iBatis
A little late for seen this message :-) I think the plus (+) is used for specifying nested class: Type t = Type.GetType(MyNamespace.MyNonNestedClass+MyNestedClass, MyAssembly); On Wed, Apr 15, 2009 at 12:15 AM, Chris Landowski ch...@aeifinance.comwrote: Hello, Is it possible to use a nested class as the resultClass for a select statement in my data map xml file? If so, what is the proper syntax? I have tried both “namespace.parentClass.nestedClass” “namespace.parentClass$nestedClass” and neither work. When retrieving the Mapper.Instance() , the following exception is thrown Could not load type from string value”. Thanks, Chris
Re: 1.6.2 / V3 ???
I asked the same question serveral months ago ... still waiting for an answer. On Fri, Apr 17, 2009 at 2:14 AM, Sal Bass salbass...@hotmail.com wrote: Hello, It seems there is a great deal of development in the java version, but not the .NET version. The last thing released was the 1.6.2 beta and a full release was supposed to follow soon after. Is the .NET version still in active development? -- Windows Live™: Life without walls. Check it out.http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1b_explore_042009
Re: 1.6.2 / V3 ???
The 1.6.2 in beta for a long time would a 1.6.2 GA be released before a new release based on V3 branch? On Fri, Apr 17, 2009 at 12:11 PM, Clinton Begin clinton.be...@gmail.comwrote: Hey all, Gilles was making good progress on V3, and I think there are a few people already using the source build. I'm not sure why everything went quiet all of a sudden... Gilles? Ron? Clinton On Thu, Apr 16, 2009 at 9:30 PM, Yaojian sky...@gmail.com wrote: I asked the same question serveral months ago ... still waiting for an answer. On Fri, Apr 17, 2009 at 2:14 AM, Sal Bass salbass...@hotmail.com wrote: Hello, It seems there is a great deal of development in the java version, but not the .NET version. The last thing released was the 1.6.2 beta and a full release was supposed to follow soon after. Is the .NET version still in active development? -- Windows Live™: Life without walls. Check it out.http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1b_explore_042009
Re: Prob: using varnibary in iBatis asp.net
why not define the ANSWERTEXT as Varchar or NVarchar ? On Tue, Apr 7, 2009 at 9:56 PM, Jain Mohit j.mo...@yahoo.com wrote: Hi, I am using ASP.Net 2.0 framework/C# SQL server 2000 and using iBatis for database interactions. In the code snippet below (bold text), ANSWERTEXT field is of type Varbinary. While inserting data to this field, I used convert function. INSERT INTO SecretAnswer(ParticipantId, QuestionId, QuestionCode, ANSWERTEXT) SELECT ParticipantId, #questionId#, #QuestionCode#, CONVERT(varbinary(255),#Answer#) From table.(some join conditions) Case 1. In case of 'Answer' being a normal alpha numeric string test123, it converts the string to varbinary properly and while validating, I am able to validate properly. select convert(varchar(100), answer) from table Result: test123 Case 2. In case of 'Answer' having any special character (e.g. apostrophe), it does the same. However, when I execute the following in query analyzer, the result is not equal to the original string. E.g. Answer = test'123 Inserted this using above insert statement. Executed following: select convert(varchar(100), answer) from table The result comes only single char: t While select convert(nvarchar(100), answer) from table, returns test'123, which is a problem. Can someone look into this and respond accordingly? Regards, Mohit Jain -- View this message in context: http://www.nabble.com/Prob%3A-using-varnibary-in-iBatis-asp.net-tp22929580p22929580.html Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.
Re: Prob: using varbinary in iBatis asp.net
My guess is to put 'dbType' in IBatis.NET sqlMaps. strategy 1: Defines the column as varbinary and convert to string at the client-side (using C#) define 1) the sqlserver database type of the ANSWERTEXT column is varbinary(100) 2) and the C# type of the corresponding 'AnswerText' field/property is Byte[] and in sqlMap: 1) the insert statement may looks like: insert ...INSERT INTO SecretAnswer (..., ANSWERTEXT) values (#AnswerText,dbType=VarBinary#)/insert 2) the select statement may looks like: resultSet ... result property=AnswerText column=ANSWERTEXT dbType=VarBinary/ /resultSet select...SELECT ..., ANSWERTEXT from SecretAnswer There's no need to call the CONVERT function in the SELECT statement. strategy 2: Defines the column as varbinary and convert to string at the server-side define 1) the sqlserver database type of the ANSWERTEXT column is varbinary(100) 2) the AnswerText field/property as String and in sqlMap: 1)insert ...INSERT INTO SecretAnswer (..., ANSWERTEXT) values (CONVERT(varbinary(100), #AnswerText,dbType=NVarChar#)/insert 2)result property=AnswerText column=ANSWERTEXT dbType=NVarChar/ select ... SELECT ..., CONVERT(nvarchar, ANSWERTEXT) from SecretAnswer On Tue, Apr 7, 2009 at 10:30 PM, Jain Mohit j.mo...@yahoo.com wrote: As per requirement, it should be encrypted and can not be changed to any other type. Yaojian wrote: why not define the ANSWERTEXT as Varchar or NVarchar ? On Tue, Apr 7, 2009 at 9:56 PM, Jain Mohit j.mo...@yahoo.com wrote: Hi, I am using ASP.Net 2.0 framework/C# SQL server 2000 and using iBatis for database interactions. In the code snippet below (bold text), ANSWERTEXT field is of type Varbinary. While inserting data to this field, I used convert function. INSERT INTO SecretAnswer(ParticipantId, QuestionId, QuestionCode, ANSWERTEXT) SELECT ParticipantId, #questionId#, #QuestionCode#, CONVERT(varbinary(255),#Answer#) From table.(some join conditions) Case 1. In case of 'Answer' being a normal alpha numeric string test123, it converts the string to varbinary properly and while validating, I am able to validate properly. select convert(varchar(100), answer) from table Result: test123 Case 2. In case of 'Answer' having any special character (e.g. apostrophe), it does the same. However, when I execute the following in query analyzer, the result is not equal to the original string. E.g. Answer = test'123 Inserted this using above insert statement. Executed following: select convert(varchar(100), answer) from table The result comes only single char: t While select convert(nvarchar(100), answer) from table, returns test'123, which is a problem. Can someone look into this and respond accordingly? Regards, Mohit Jain -- View this message in context: http://www.nabble.com/Prob%3A-using-varnibary-in-iBatis-asp.net-tp22929580p22929580.html Sent from the iBATIS - User - Cs mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/Prob%3A-using-varnibary-in-iBatis-asp.net-tp22929580p22930420.html Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.
Re: DataMapper 1.6.2 and DataAccess 1.9.2
The V3 for cs has no commit since 19 oct. How about the progress? Is V3 still alive? 2009/1/9 Rafi Ghazarian rghazar...@privateaccess.info How stable are these beta releases? When is the general release availability anticipated to happen? Thanks, Rafi
Embed inline-parameter-map in simple-dynamic-sql element?
Hi, How to make the IBatis.NET support embedding inline-parameterpmap in simple-dynamic-sql element ? For example, I have the following pseudocode: == in the sql map: select id=DynamicSqlStatement resultClass=System.Collections.IDictionary parameterClass=String $__DynamicSql$ /select and in code: Hashtable paramObject = new Hashtable(); paramObject.Add(__DynamicSql, SELECT CATALOG_NAME, SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE (CATALOG_NAME = #CatalogName,dbType=NVarChar#); paramObject.Add(CatalogName, master); Mapper.QueryForListIDictionary(DynamicSqlStatement, paramObject); = Currently, this result is a sql exception as the IBaits.NET send the text of __DynamicSql directly to the sql server and so the #CatalogName,dbType=NVarChar# is not a valid sql fragement. I want the IBatis.NET treat the CatalogName as an inline-parameter-map instead of send the original text of __DynamicSql directly to sql server. It's may require the IBatis.NET parse the content of a mapped-statement recursively?