The problem is :
I have a working system with FluentNhibernate.
I have a legacy database and it's hybrid system which suppose to give an answer to a new and old systems as one. So that means I couldn't use the Version - which means at this point to change the schema and add column to each table.
I've added OptimistickLock.Dirty() with ...
Hi all
My domain classes have collections that look like this:
private List<Foo> _foos = new List<Foo>();
public virtual ReadOnlyCollection<Foo> Foos { get { return _foos.AsReadOnly(); } }
This gives me readonly collections that can be modified from within the class (i.e. by using the field _foos).
This collection is mapped as follo...
Hello guys...
My Class Client :
public class Client : Entity
{
public Client()
{
ListClientObjectX = new List<ClientObjectX>();
}
public virtual IList<ClientObjectX> ListClientObjectX { get; set; }
...
}
My Class ClientObjectX
public class ClientObjectX: Entity
{
public ClientObjectX()
...
One of the many reason to use FluentNHibernate, the new QueryOver API, and the new Linq provider are all because they eliminate "magic string," or strings representing properties or other things that could be represented at compile time.
Sadly, I am using the spatial extensions for NHibernate which haven't been upgraded to support Query...
Because there is so little information about VB.Net and (Fluent) NHibernate to be found, I decided to write this question to all other developers finding themselves looking for more information.
On of the things i had to struggle with was how to Ignore properties in NHibernate.
The reason i had to ignore properties was because we used ...
I'm developing a question/answer based application
I have a Post table in the db along the lines of:
ID
Title
Body
DateCreated
AuthorID
AuthorName (in case user not registered)
AutherEmail (as above)
PostType (enum - 1 if question, 2 if reply)
Show (bit field)
Then, there is "PostBase" - which is an abstract class (this has pro...
So I'm a couple of weeks into NHibernate so pleae bear with me. I am working on a legacy database with lots of weird issues.
I have a name object
public class Name {
public Name()
{
Addresses = new List<Address>();
}
public virtual string Id { get; set; }
public virtual str...
I'm testing Fluent NHibernate with NorthWind database. Now, I've created Employee and EmployeeMap class. Source code is like below.
class Employee
public class Employee
{
public virtual int EmployeeID { get; private set; }
public virtual string LastName { get; set; }
public virtual string FirstName { get; set; }
public ...
What's the best approach for testing multiple db's in a s#arparch project?
The current SetUp() code in MappingIntegrationTests tries to test each assembly against the first database.
string[] mappingAssemblies = RepositoryTestsHelper.GetMappingAssemblies();
configuration = NHibernateSession.Init(new SimpleSessionStorage(), mappingAss...
I'm a big believer in DRY so after setting up ClassMap objects in fluent nhibernate, how can I consume these mappings in code not using Nhibernate?
Edit: Example, I have a class that is mapped but also uses a stored procedure to populate itself and it's children (and their children) in a single database call. When populating objects fro...
I am rather stumped on this.
Fluent Nhibernate v1.1.0.685
NHibernate v2.1.2.4000
When I check the ModelState.IsValid prop before calling the Save() on the Repository. The IsValid prop is always False. When debugging the Id value is "" (empty) in the Model. I have overridden the Mappings for the Id :: mapping.Id(x => x.Id).GeneratedBy.I...
Hello,
I'm new to fluent nHiberbate and wanting to put into use in one of my projects. And I'm currently having trouble mapping a class that has both inheritance and self-referencing properties.
Here's my scenario:
I have an abstract class called Applicant
public abstract class Applicant: IApplicant
{
public virtual long Id {...
Fluent NHibernate or NHibernate, Which one should we prefer for linq support?
...
I have a table that contains information from many customers
ID | employeename | customerId
------------------------------
1 | employee1 | 188
2 | employee2 | 188
3 | employee3 | 177
Now I would like to get only those employees, whose customerId is 188. How do I map this with Fluent NHibernate so, that on update and del...
I have multiple databases in my SharpArchitecture project and followed the guide outlined here:
http://wiki.sharparchitecture.net/FAQ.ashx
Everything works fine, except for my entities with assigned ids. I get a "database already configured" when trying to startup the application. Through some digging I get:
"Identity type must be int...
How can I achieve this query using DetachedCriteria:
Select * from
MyTable
Where
(conditionA = true) or
(conditionB = true) or
(conditionC = true) or
(conditionD = true)
...
Hi using fluentnibernate automappings
to map this
public virtual int Id { get; set; }
/*...snip..*/
public virtual MapMarkerIcon MapMarkerIcon { get; set; }
}
to this
CREATE TABLE [Attraction](
[Id] [int] IDENTITY(1,1) NOT NULL,
[MapMarkerIconId] [int] NULL
)
with this:
var cfg = Fluently.Configure()
...
Is it possible to create a simple convention to modify the polymorphism mode of a class, if there is a joined-subclass ?
Doing this :
public class EntityMap : ClassMap<EntityBase>
{
public EntityMap()
{
Polymorphism.Explicit();
}
}
but inside a convention. Using IClassConvention doesn't work, as the Polymorphism p...
I am creating a set of conventions for Fluent nHibernate. I create a few conventions, like primary key, foreign key and many-to-many table.
I would like to be able to test out these conventions with an in memory database to see if I coded these conventions correctly.
Currently, I am setting up nHibernate using an SQlite in-memory datab...
I am facing an issue while trying to delete a many-to-many relationship using Fluent Nhibernate. I have following domain classes:
public class Organisation
{
public virtual int Id {get; set;}
private IList<OrganisationRelationshiop> relatedOrganisations;
public virtual IList<OrganisationRelationship> RelatedOrganisation
...