I have two tables that are considered a single entity in my domain model.
I join them in my IAutoMappingOverride by calling IgnoreProperty on the properties of the joined table and then using Join with a Map for each of the properties.
This configuration works, but I'm lost at attempting a filter on the columns of the joined table. I...
Hi,
I wonder if you could help me with something I've been thinking about. Say we have an Entity. Say the endtity has an ExtendedInfo object, which contains various properties which are not often used.
I'm wondering how best to structure this for FNH. The easiest thing to do I suppose would just set the UserInfo up as a Fluent Nhibe...
Hi,
I've had a system up and running that used the Fluent NHibernate pre-release v0.0.1.0 along with NHibernate 2.1.0.4000 and NHibernate.Linq 1.0.0.0.
I've just put in the new Fluent NHibernate RTM dlls and fixed my code for the breaking changes but I'm getting a couple of issues dependant on how I try to implement.
1) If I don't cha...
what is the best code generator for NHibernate?
...
I'm trying to perform a simple query using ADO.NET Data Services running against LINQ to NHibernate. I can execute this query
var query = _context.CreateQuery("FileDTOs")
.Where(file => file.Name.Contains("name"));
I can run a similar query directly against LINQ to NHibernate without issues, but when I pass the same q...
I'm currently adding features to an ASP.NET WebForms application that relies on NHibernate Burrow, and would like to replace the standard ASP.NET form validation controls with something that integrates with model-level validation.
NHibernate Validator was easy to implement on the models, but I am unsure on how to get matching client-si...
I finally figured out what's wrong with my code, but I'm not sure how to fix it. I have some background processes running on a separate thread that perform some database maintenance tasks. Here's an exmple of what's happening:
//Both processes share the same instance of ISessionFactory
//but open separate ISessions
//This is running on...
I've crossed posted this in the FNH Google Group but here's the scoop:
I have a table in a legacy database that has a composite ID. Well, the
PK is implied since the table doesn't actually have a PK defined, but
the natural PK is the combination of the WORKORDERID and IMAGEPATH
columns:
CREATE TABLE [WORKORDERIMG](
[WORKORDERID]...
From my understanding NServiceBus executes the Handle method of an IMessageHandler within a transaction, if an exception propagates out of this method, then NServiceBus will ensure the message is put back on the message queue (up X amount of times before error queue) etc.. so we have an atomic operation so to speak.
Now when if I inside...
Hi. Is there a way to monitor the round-trips to the database in an NHibernate application?
I need just a log to see when NHibernate connects to database.
...
I'm learning NHibernate and was looking at some code recently where NHibernate was used in an ASP.Net MVC project.
In a certain part of this app, entities loaded from NH are being kept in the (HttpContext) Session. Is this OK, or are there any dangers with this if you use (NHibernate) Session-per-request pattern?
...
I have the following code
string idName = builder.IdentifierName;
Disjunction disjunction = Restrictions.Disjunction();
IList ids = new ArrayList(entityInfos.Length);
foreach (var entityInfo in entityInfos)
{
ids.Add(entityInfo .Id);
}
disjunction.Add(Restrictions.In(idName, ids));
criteria.Add(disjunction);
criteria.List();
(I ha...
How can I save a collection of objects in NHibernate?
I'm migration from SubSonic (I don't like SubSonic 3 version and SubSonic 2 is dead...) and this used to be a simple operation...
There is a way to map a collection(without associations) to complete this task?
My actual code is:
using (ISession session = NHibernateHelper.GetCurrent...
Hi,
I'm trying to follow DDD, or a least my limited understanding of it.
I'm having trouble fitting a few things into the DDD boxes though.
An example: I have a User Entity. This user Entity has a reference to a UserPreferencesInfo object - this is just a class which contains a bunch of properties regarding user preferences. These ...
I'm working on a model for a simple fishing competition and I have some issues with my design.
The main class for the fishing game is Capture and it looks like this:
public class Capture : Entity {
public virtual int Weight { get; set; }
public virtual int Length { get; set; }
public virtual DateTime DateForCapture { get; ...
Hi,
I'm trying to accomplish the following query (notice .StartsWith):
return (from p in _session.Linq<Profile>()
where (p.Firstname + " " + p.Lastname).StartsWith(wildcard)
select p).ToList();
This throws: could not resolve property: Firstname.Lastname.
If I do this:
return (from p in _session.Linq<Profile>()
...
I Have this Product Class i took from the examples of how to use nhibernate (but i did some modifications to it)
I want to be able to map a class and all of it's references into the DB.
[NHibernate.Mapping.Attributes.Class(Lazy=true)]
public class Product
{
[NHibernate.Mapping.Attributes.Id(Name="Id",TypeTyp...
I have a fairly slick approach to doing C# development using the above tools/methodologies. Specifically i follow the "Jeffrey Palermo Agile Bootcamp" onion architecture. I feel like I'm a strong developer/architect using these tools and that these make me more productive and help make more maintainable code. I think these are all imp...
The following code demonstrates a misleading situation in which data
is committed to the database, even though commit is never called on a
transaction.
Could anyone explain why?
[TestFixture]
public class TestFixture
{
[Test]
public void Test()
{
var config = DoConfiguration();
using(var...
I am using Nhibernate for oracle, and I need to increment my primary key value for each insert. Which one is the best way and efficient way? Oracle sequence, Nhinerbate increment or another way?
...