All Questions
Tagged with mapping nhibernate
424
questions
-1
votes
2
answers
69
views
How can i map a computed list property in nhibernate
My model contais the following:
public virtual DateTime LastSessionDate { get; set; }
public virtual List<double> Values { get; set; }
Values should be selected from other tables in a custom ...
0
votes
1
answer
58
views
Problem getting list of related purchase order lines in sales order line
In my domain several purchase order lines can be assigned to one sales order line.
When the purchase order is created it is saved in the database with a new natural Primary Key (DocEntry, LineNum) and ...
1
vote
1
answer
46
views
Problem mapping Fluent NHibernate One-To-Many
I am having issues mapping two classes to a database via Fluent NHibernate.
My classes are Asset and LogData.
Asset has a bunch of decimal configuration values, and a Log which is a LogData.
public ...
0
votes
2
answers
70
views
NHibernate Map an Object without a table
I'm trying to map the following object:
public class DatabaseInfo
{
public virtual DateTime CurrentDateTime { get; set; }
}
with the following map:
public class DatabaseInfoMap : ClassMapping<...
-1
votes
1
answer
55
views
Adding a Schema Prefix to a Table using XML Mapping - needed to convert a MSSQL Database to a MySQL
I have NHibernate XML mapping files that work wonderfully in MSSQL Databases. An example of a table is:
<class name="Worm" table="`Worms`" schema="`dbo`">
Now I need to use the exact same ...
1
vote
1
answer
1k
views
NHibernate - Error dehydrating property value - updating entity
I'm having problem when saving an entity with association. Below is my code which gives the error
Fluent Class inherited from Fluent Migration
public override void Up() //Update your changes to ...
0
votes
1
answer
1k
views
error "The element 'class' in has invalid child element 'set' in namespace " when mapping hbm file
H want to use inheritance in my application but when I run, my hbm mapping file has error. my code is here
public class StudentDao
{
public virtual int Id { get; set; }
public ...
0
votes
1
answer
68
views
Mapping interface using FluentNhibernate and Autofac
i'm have a hard and extreming question, how i'm may using FluentNHibernate for mapping a interface? follow a example below how i'm imagine do:
I'm have a interface:
public interface IUser
{
...
0
votes
1
answer
471
views
NHibernate select specific column
public class Company_Product
{
public virtual Int32 Id { get; set; }
public virtual DateTime SalesDate { get; set; }
public virtual Company Company{ get; set; }
public virtual Product ...
-1
votes
1
answer
750
views
NHibernate OneToMany Mapping By Code
I saw many exemple on the internet on Mapping relation object with nhibernate but i can't make mine works.
I have two Model for exemple:
public class Vehicule
{
public virtual int Id { get; set;...
1
vote
1
answer
130
views
NHibernate: One-to-many
I have a class called DadosvalmetSam (Parent) which have a one-to-many relationship with DadosfuncionarioSam(Child).
Classes and mapping below:
DadosvalmetSam
public class DadosvalmetSam
{
...
3
votes
1
answer
2k
views
Nhibernate "could not initialize a collection"
I have a following problem with my NHibernate One-to-many mappings. If I want to get all Customers, by my API methods, I get a following error:
"$id":"1","Message":"An error has occurred.","...
0
votes
1
answer
878
views
PostgreSQL mapping with NHibernate
I'm working with NHibernate on both SQL Server and PostgreSQL. I encounter some problems in mapping auto_increment attributes with PostgreSQL.
Id(c => c.PlayerId, map => map.Generator(...
6
votes
2
answers
3k
views
Should I transform Entity (Persistent) objects to DTO objects?
My project is layered as follows:-
DAL (Entity) --> BLL (DTO) --> ApplicationComponent (ViewModel).
There will be multiple components of application (ApplicationComponent) which will access BLL. ...
1
vote
1
answer
210
views
NHibernate mapping class with attribute of same type
I am new to the .NET MVC. However this "problem" I am stuck at looks pretty common, I cannot find any tutorial or stackoverflow thread that explains how to do it properly.
I have a class, MyClass ...