I have the following (using Fluent NHibernate):
public class BuildAuditMap : ClassMap<BuildAudit>
{
public BuildAuditMap()
{
Table("BUILD_AUDIT");
CompositeId()
.KeyProperty(x => x.AuditDate, c => c.ColumnName("AUDIT_DATE"))
.KeyProperty(x => x.PersonId, c => c.ColumnName("PERSON_ID"));
...
Hi, I have an issue when deleting a child record from the session. Here are the entities i have defined:
public class ReportedData
{
public virtual int ReportedDataID { get; set; }
public virtual ReportedDataTypes Type { get; set; }
public virtual string Reason { get; set; }
public virtual IList<ArticleCommentReported>...
Why does the following HQL query fail?
string hql = @"delete MyLog log
where
log.UtcTimestamp < :threshold and
log.Configuration.Application = :application";
session.CreateQuery(hql)
.SetDateTime("threshold", threshold)
.SetEnum("application", this.application)
...
Hai, I`m Newbie in Fluent Nhibernate..
I have postgreSql Database and what i want is generated id with auto increment..
i have no see feature auto increment in Postgres and i was understand that for use auto increment in postgreSql i must create sequence..
there is other way beside sequence?
if create sequence is the only way, can You ...
I'm using fluent-nhibernate conventions to map my entityies:
public class HasManyConvention : IHasManyConvention
{
public void Apply(FluentNHibernate.Conventions.Instances.IOneToManyCollectionInstance instance)
{
instance.Key.Column(instance.EntityType.Name + "ID");
instance.Cascade.AllDelete...
Here is a small VS 2010 solution with a single failing test that replicates the following issue.
I have a convention UserTypeConvention<MyUserType> where MyUserType : IUserType where MyUserType handles an enum type MyEnum. I have configured Fluent NHibernate thusly
sessionFactory = Fluently
.Configure()
...
According to the REST philosophy, a PUT request should update the resource at a URL if it exists, and create it if it doesn't exist. So in other words, if I use the following URL:
PUT http://server/item/5
If an Item exists with an ID of 5, it will be updated. If an Item doesn't exist with an ID of 5, a new Item will be created with an...
I am working on an ASP.NET MVC application using NHibernate as the ORM. I have two domain objects:
public class Contact
{
public int ID { get; set }
public string Name { get;set; }
public IList<ContactNumber> ContactNumbers { get; set; }
}
public class ContactNumber
{
p...
Hi All
At this moment we are keeping all Entities and Mappings into same assembly. Our entities derived from a basic class Entity which is an EntityWithTypedId
Also we are having a table name Convention telling to pluralize the table names.
Now I want to create other two base types e.q. AggregateRootEntity and AggregateEntity, both d...
Hello all,
I have the following (simplified) mappings:
public class RosterMap : ClassMap<Roster>
{
public RosterMap()
{
References(tr => tr.Team)
.Not.Nullable();
HasMany(r => r.Players)
.Inverse()
.Cascade.AllDeleteOrphan();
References(roster => roster.Match)
...
Hi,
While working on a project, i came across to a scenario where i have to ignore table creation for a spesific class using fluentnhibernate.
Scenario
I have an existing table aspnet_Users and I have a class Person that has all the attributes of the table as property, ie: UserName, Password, LastLoginDate.
Now I need to configure Fl...
Is it possible to CREATE (not query) a stored procedure with nhibernate?
...
i'm using oracle with FluentNHibernate automapping with alterations & NHibernate
the problem is how to specify the constraint name by overriding the mapping model??
the generated sql like this:
alter table FirstTable
add constraint FK_VerLongIdentifierLongerThan30Characther
foreign key (FirstTableID)
references SecondTable...
Hello..
In my example I have Servers and those Servers belong to a ServerGroup. I am populating a ServerGroup with Servers and saving the ServerGroup. The ServerGroup table is populated but the Servers are not.
public ServerGroupMap()
{
Id(x => x.Id);
Map(x => x.Name);
HasMany(x => x.ServersInGroup)
...
In my map I have:
Component(
x => x.ExposureKey,
m => {
m.Map(x => x.AsOfDate).Not.Nullable();
m.Map(x => x.ExposureId).Length(30).Not.Nullable();
}
).Unique();
The relevant output from the HBM is
<component name="ExposureKey" insert="true" update="true" optimistic-lock="true" class="Some.Namespace.CreditE...
I have a legacy database with 3 tables like this:
The Items table contains all the Items in a Plan.
The Structure table defines the relation between the items.
A parent item is defined by company, year, planId and parentItem of table structure mapping to company, year, planId and id of table item.
A child item is defined by company, yea...
I need help on this.
I got this error while inserting/updating a number of records
could not load an entity:
[Star.CNPL_BusinessObjects.Entities.CNPL.CNPL_AgencyProduct#48][SQL: SELECT cnpl_agenc0_.Id as Id48_0_, cnpl_agenc0_.AgencyID as AgencyID48_0_, cnpl_agenc0_.ProductID as ProductID48_0_, cnpl_agenc0_.CreatedDate as CreatedD4_48_...
Hi All,
I use as a front-end sproutcore, and as back-end an nhibernate driven openrasta REST solution.
In sproutcore, references are actualy ID's / guid's. So an Address entity in the Sproutcore model could be:
// sproutcore code
App.Address = App.Base.extend(
street: SC.Record.attr(String, { defaultValue: "" }),
houseNumber: SC.R...
I have just discovered that I don't think my nhibernate setup seems to be cacheing properly. I'm running a SQL server profiler and neither the 1st or 2nd level cache appear to be working.
For my queries I'm using:
var queryable = NHibernateSession.CurrentFor(NHibernateSession.DefaultFactoryKey).Linq<Accommodation>();
queryable.QueryOpt...
When using auto mappings in Fluent NHibernate, you have the ability to do something like:
_configuration =
Fluently.Configure().
Database(
MsSqlConfiguration.MsSql2000.ConnectionString(
@"some connection string")
)
.Mappings(
m => m.AutoMappings.Add(AutoMap.Assembly...