What is the best way to map UInt32 type to sql-server int type with NHibernate.
The value is a picture width/height so negative value are not make sense here.
But maybe I should use int because NHibenate doesn't support unassigned ints.
...
It seems that LINQ-to-NHibernate and LINQ-to-SQL does not support short-circuit evaluation in where clause of query.
Am I right?
Is there any workaround?
May it be added to next versions of LINQ-to-NHibernate and LINQ-to-SQL?
for more information plz see followings:
http://stackoverflow.com/questions/772261/the-or-operator-in-linq-w...
var cfg = new Configuration();
cfg.Configure();
cfg.AddAssembly(typeof(<ClassName>).Assembly);
new SchemaExport(cfg).Execute(false, true, false, false);
The above piece of code is supposed to create a database Table with name
But it is not creating...
Can someone help me out on this...
It is very urgent...
...
When i configure NHibernate it seems to do an
Audit Login
-- network protocol: LPC
set quoted_identifier on
set arithabort off
set numeric_roundabort off
set ansi_warnings on
set ansi_padding on
set ansi_nulls on
set concat_null_yields_null on
set cursor_close_on_commit off
set implicit_transactions off
set language British
set dateform...
Hi,
I'm trying to learn about SQL named queries using NHibernate and I have the following code. The issue is that I get the following error : "Message: No value given for one or more required parameters." when I try to test the code from MBUnit.
<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2...
Hi,
I am attempting to use spring.net and nihibernate for my data layer.
I have a simple DAO object that includes the following code:
[Transaction]
public long Save(Request entity)
{
return (long)CurrentSession.Save(entity);
}
Whenever this code is called I get the following error:
"No Hibernate Session bound to thread, and ...
Hi,
I am working on an asp.net business application and using nhibernate. My objective of using nhibernate is to minimize/avoid application porting effort on different databases(Oracle, SQL Server, Postgres etc).
I have a scenario where i have to dynamically check the database table schema and build some functionality on it. First thing...
Hi guys. How to force NHibernate not to generate UPDATE for each element in collection if I change only one element of that collection. Here it is:
internal class Master
{
private int _id;
public string Name { get; set; }
public ISet<Slave> Slaves { get; set; }
public Master()
{
Slaves = new HashedSet<Slave...
Hi,
My object looks something like this:
class
{
int a;
object b;
IList<string> c;
}
All the fields are getting populated from the database and the collection is getting lazy initialization which is desirable.
Now, my problem is that I want to send this object to the web service. But since the collection is lazily loaded...
How to use native Sql for Insert and Update in Castle Active Record? There are sample for using Select query here http://www.castleproject.org/activerecord/documentation/trunk/usersguide/nativesql.html
But I can't find any sample for Update and Insert.
Update: Basically I am looking for a support for Update/Insert query like this.
<...
Hello all,
I am saving in my DB a TimeSpan (from .NET) value as BIGINT in SQL Server (saving the Ticks property). I want to know how to convert this BIGINT value to a DATETIME value in SQL Server (not in .NET). Any ideas?
Cheers
EDIT:
I am using NHibernate to map a TimeSpan property I have, and it persists the Ticks property. I use i...
I have a simple Result class that used to be an Enum but has evolved into being its own class with its own table.
public class Result {
public static readonly Result Passed
= new Result(StatusType.Passed) { Id = [Predefined] };
public static readonly Result NotRun
= new Result(StatusType.NotRun) { Id = [P...
I read with excitement the first article that popped up in google -- it was exactly my problem. I have an object model with a non-null date field, but the underlying database field was nullable, and had a null value. It was a DateTime. nHibernate set the value to .Net's Date.MinValue, then tried to save it back, yielding an error.
Th...
Came across something like this today, and was wondering if there was an equivalent way to solve it in criteria queries.
Basically, there is a table, and this table has two nullable string fields (foo and bar). We wish to sort by the aggregate of these.
string concatenation (order by foo + bar desc) returns null if one of the values is...
I have two domain objects: Product and ProductDictionary, which are both abstract classes and they both have many concrete subclasses. They are connected via many-to-many association. I would like to reuse one join table for all associations between Product and ProductDictionary subclasses, because I don't want to polute my DB with unnec...
For some reason the following mapping seems to be creating me a very strange column name that I cant find anywhere. There error occures when trying to load the Events collection which is defined as a IList<Event>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="JeanieMaster.Domain....
Hi all,
these are my entities (simplified):
public class IdentificationRequest
{
private int id;
private ICollection<IdentificationRequestStateHistoryItem> stateHistoryItems;
public virtual string Id
{
get { return id; }
private set { id = value; }
}
...
It is asked before but that was one year back. I would like to know if it is ready for production now?
...
Hi!
I have a many to many association between a Team and an Employee.
public class Employee : Entity
{
public virtual string LastName { get; set; }
public virtual string FirstName { get; set; }
public virtual string EMail { get; set; }
public virtual IList<LoanedItem> LoanedItems { get; private set; }
public virtual...
I am trying to reference some child entities with part of the parents composite key not all of it, why cant I? This happens when I use the following mapping instead of that which is commented.
I get the following error
Foreign key in table
VolatileEventContent must have same
number of columns as referenced
primary key in tabl...