-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: illegal access to loading collection
PostPosted: Tue Jul 20, 2010 6:35 am 
Newbie

Joined: Tue Jul 20, 2010 6:34 am
Posts: 2
In the CategoriesTranslated collection i have this error: illegal
access to loading collection.

public class Category : Entity
{
public Category()
{
CategoriesTranslated = new List<CategoryTranslated>();

}

public virtual Category Parent { get; set; }
public virtual string Name { get; set; }
public virtual IList<CategoryTranslated> CategoriesTranslated
{ get; set; }

}

public class CategoryTranslated : Entity
{
public CategoryTranslated()
{
}

public virtual Category Category { get; set; }
public virtual LanguageType Language { get; set; }
public virtual string Name { get; set; }

}

public void Override(AutoMapping<Category> mapping)
{
mapping.HasMany(x => x.CategoriesTranslated)
.Inverse()
.Cascade.All();

}

public void Override(AutoMapping<CategoryTranslated> mapping)
{
mapping.References(x => x.Category);
}

//Db
CREATE TABLE Category(
[Id] smallint primary key identity(1,1),
[Parent] smallint null, [Name] varchar(50) not null unique, )
alter table [Category] add CONSTRAINT fk_Category_Category
FOREIGN KEY(Parent) references Category (Id)
go

CREATE TABLE CategoryTranslated(
[Id] smallint primary key identity(1,1),
[Category] smallint not null,
[Language] tinyint not null,
[Name] varchar(50) not null, )

alter table [CategoryTranslated] add CONSTRAINT
fk_CategoryTranslated_Category
FOREIGN KEY(Category) references Category (Id) go
Where is it wrong? thank you


Top
 Profile  
 
 Post subject: Re: illegal access to loading collection
PostPosted: Tue Jul 20, 2010 9:35 am 
Newbie

Joined: Tue Jul 20, 2010 6:34 am
Posts: 2
Nobody can help me please?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.