SchemaExport seems to work, but SchemaUpdate fails - the SchemaUpdate.Exceptions contains this object:
System.NotSupportedException: The method is not supported.
in System.Data.Common.DbConnection.GetSchema(String collectionName, String[] restrictionValues)
in NHibernate.Dialect.Schema.AbstractDataBaseSchema.GetTables(String catalog, St...
Hi,
I'm trying to query using Castle and return a strong-typed array or IList for later use in data binding, so from i read a ProjectionQuery would be my best choice, but how would i transform this to a projection query:
HqlBasedQuery hql = new HqlBasedQuery(typeof(TrackingRule),
Query...
Hi!
I have a database that has a one-to-one relationship modeled between a Person and a Address (that uses person id). However, I cannot find a way to make the map using NHibernate.
My table structure is the following:
PersonTable
PersonId
PersonName
PersonAge
AddressTable
PersonId
CountryName
StreetName
StateName
And I would l...
We have the following table structure:
tbl_A
A_ID INT PK
Type_ID INT
tbl_EA
EA_ID INT PK
A_ID FK to tbl_A
C_ID INT (reference to other table based on Type_ID from tbl_A)
tbl_C
C_ID INT PK
So, we're thinking tbl_A is abstract class, and each type is a
subclass, discriminator based on Type_ID. But then we ...
Short Version
This query works in the database but fails with Linq To NHibernate. Why?
var items = (from g in db.Find<DataGroupInfo>()
where (from d in g.data where d.Id == dataID select d).Count() > 0
select g).ToList();
Detailed Long Version
I have two objects mapped by NHibernate Automapper with a Ma...
I'm developing a web application with VS2008 and NHibernate and I cannot access my database (MSSQL Server 2005).
Here is my stack trace
[SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Se...
Background
I really like Fluent NHibernate - it's pretty great. I don't have to write those mundane CRUD-based SQL stored procedures and that's great (not that there's anything wrong with that)!
I've gone down this path a bit on an application we're working on. And now I'm sitting with a couple dozen domain objects, each with a reposit...
I'm working on a project with NHibernate that classes similar to the following:
public class Parent {
public IList Children {get;set;}
// ...
}
public class Child {
// ...
}
I've got the Children property set to cascade all / delete orphan. Since I'm using the aggregate pattern and instances of Child class will only ever ...
I have a root object, Policy, that has a compositeKey of PolicyNumber/PolicyDate.
The Policy has a one-to-many collection of PolicyDetails which have a composite key of PolicyNumber/PolicyDate/Sequence. Sequence is an assigned value that is set by the application.
My Mapping for Policy is below. I'm able to do a get and populate my c...
Does Castle ActiveRecord supports SQL formula as supported by nHibernate?
E.g. In nHibernate we can do something like this.
<property name="CountOfPosts"
formula="(select count(*) from Posts where Posts.Id = Id)"/>
Is this supported in Castle Active Record?
...
Hi All,
I have been sifting through pages on Google looking for the answer to no avail, however I think I am just phrasing the question incorrectly.
The scenario is as follows: I have an entity which users are able to either vote for or against. For arguments sake lets call the entity a business.
I would like to have a property on my ...
Lets say I have two entities: Stable, and Pony.
Stable has an IList<Pony> with a HasMany mapping configured with Cascade.All().
That means that if I do session.Save(myStable), each Pony in the collection will be saved.
However, what happens if I do this?
Pony myLittlePony = new Pony(Color.Brown);
Stable myStable = new Stable(WoodType...
I want to load the list of users and their roles, with this query:
var q = from u in session.Linq<User>()
select new
{
u.Name,
u.Password,
Roles = from r in u.Roles
select new { r.Code, r.Name }
};
But this query is not working.
Produce the following ...
What are the access strategies that I can use in the attribute access of the nhibernate xml?
Can someone point me the possible values to be used in it?
A nice tutorial would be very appreciated.
Thanks
...
Hi all. I have a Silverlight Business Application project set up, with these codes.
I have this domain class:
public class BaseDomain
{
public virtual Guid Id { get; set; }
public virtual DateTime CreatedOn { get; set; }
}
public class Sector : BaseDomain
{
public virtual string Code { get; set; }
public virtual string...
I've experienced a couple of days ago, that a problem with the name of the fields in the final query. It was a bug from a version before the 2.0.GA.
To not drag too long on this, it was a problem when the query is too big, and you use SetMaxResults altogether. It got me a though:
Would there any way to control how NHibernate is going to ...
If I have the FlushMode as Never and if I do a session.Close() will the changes be persisted to the database?
Or do we have to explicitly say session.Flush() before session.Close()?
Thanks
...
I have a component that i want to store to an SQLite database.
public class Comp : Entity
{
public virtual DateTime TimeStamp { get; set; }
public virtual String Name { get; set; }
}
public class CompMap : ClassMap<Comp>
{
public CompMap()
{
Id(x => x.Id);
Map(x => x.TimeStamp);
Map(x => x.Name);...
Hi,
Not sure what I am doing incorrectly here with NHibernate. I have two mapping files mapped to two tables. I can insert data through the mapping into the database, but calling the below code returns 0, even though I can see a child row populated in the table with the correct foreign key. Is this a lazy loading issue? Thanks.
var res...
I had an issue with my search not return the results I expect.
I tried to run Luke on my index, but it said it was locked and I needed to Force Unlock it (I'm not a Jedi/Sith though)
I tried to delete the index folder and run my recreate-indicies application but the folder was locked. Using unlocker I've found that there are about 100 ...