mapping

Hibernate query with partial key

I have two database tables, both mapped using Hibernate. The first table has a primary key with one field. The second has a composite primary key with three fields. Suppose I try to fetch results from the second table by providing just the partial key (one field), then I get an exception Exception in thread "main" org.springframework.o...

stored procedure mapping Entity Framework

Hi, We're using a Function Import in an EF4 model to populate an existing entity in our Model. The entity in the model has a Key field of Id which we're struggling to map as our stored procedure doesn't return an Id field. I've tried setting the value in the mapping to a literal value of 0 but that fails with an EntityCommandExecution...

NHibernate data retrieve problem.

These codes are working well when saving data. But it is unable to retrieve data from b_TeacherDetail-table. For example: TeacherRepository tRep = new TeacherRepository(); Teacher t = tRep.Get(12); Here, t.TeacherDetail is null. But I know that there is an entry in the b_TeacherDetail-table for teacher-id 12. Why? My tables are: T...

Map multiple xml feeds to one object

Using C# I want to be able to map a number of xml feeds to one custom object. Each xml feed has the same kind of data but has its own naming convention. Ideally i would like to store for each xml feed its own mapping and apply that automatically when copying the xml data to my object. I would like to do this as the system may grow to h...

need help to convert this mapping file from NHibernate to Fluent NHibernate

i want to convert this mapping file from NHibernate to Fluent NHibernate <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="CustomCollectionsBasic.Core.Category, CustomCollectionsBasic.Core" table="Categories"> <id name="ID" column="CategoryID" unsaved-value="0"> <generator class="identity" /...

String[] type property mapping on nhibernate...is possible?

Is possible mapping vector types on nhibernate? I have a property like this... string[] myDesc and I would map every vector value to a specific column of my table...for example: myDesc[0] --> myDbColumn01 myDesc[1] --> myDbColumn02 myDesc[2] --> myDbColumn03 ... Is there any way to do it? ...

User View Profile

Hi All, I am building an application for my client and I am not using any frameworks . Question came up when building viewing user profile My client wants to see the user profile URL like mywebsite.com/Johnd - should give Johnd profile mywebsite.com/KJohns - should give KJohns profile I have implemented URL mapping like http:/...

How to adjust constraints / DB mapping for Map within grails domain class

Following grails domain class: class MyClass { Map myMap } Now for myMap, grails automatically creates a new table for the elements in the map. However if I add elements which are too long (e.g. 1024 characters), I get a DB error. Can I somehow tell grails to make the respective column in myMap's table big enough to allow for large...

python: How do I assign values to letters?

I want to assign a value to each letter in the alphabet, so that a -> 1, b -> 2, c -> 3, ... z -> 26. Something like a function which returns the value of the letter, for example: value('a') = 1 value('b') = 2 etc... How would I go about doing this in python? ...

Are there reasons to use get/put methods instead of item access?

I find that I have recently been implementing Mapping interfaces on classes which on the surface fit the model (they are essentially just key-value stores with no more meta-data), but underneath they are sometimes quite complex. Here are a couple examples of increasing severity: An object which wraps another mapping converting all obj...

Performasure and hibernate

I have some pojos, which are mapped to a tables in database. When I deploy my code into performance tuning environment, I receive bunch of org.hibernate.MappingException due to $performasure_j2eeInfo is added to them by PerformaSure tool. Is there a way, I can configure my hibernate context file, so this field mapping will ignore mapp...

BizTalk namespace default prefix

Hello, BizTalk produced namespace default prefix as NS0. Is there a way to override it to generate something different without utilizing an XSLT (it's an overhead when the schema changes, XSLT has to be updated as well)? Something like <pidx:Invoice> and not <ns0:Invoice> This should be simple (after all it's just a namespace pr...

hibernate - spring/bean mapping set

I'm pretty much a newb with spring-hibernate and I have been trying to make it work. I have a data model like this: patient prescription ---------- -------------- patient_id* prescription_id* first_name patient_id* last_name date ... I'm using spring beans with hibernate ...

How to map this relationship in Hibernate ?

I have 2 tables : The table Data : id, plus many fields. Some of these fields are 'codes' which reference multilanguage values from the next table, for example country_code, continent_code. The table Thesaurus which contains the multilanguage codes, with columns: code, code_type, language, text. Code is unique for one code_type but the...

XML Schema to be modified in excel (VSTO)

Hi, I am new to VSTO. I have mapped an excel document with XMl Schema.Now I need to create a functionality to change the xml schema in excel(On click a button it should show me the column of XML in tress view cntrol or in the list box) under which i should be able to delete some column and change the order of column . Any help will be...

Runtime one-way mapping of n tables to 1 class in Hibernate

Hi, I have data in different tables but in the same database, all of which have the same schema. Depending on some runtime variable, I want to choose which table to use when querying Hibernate. Is this possible? Note that I only use Hibernate to read table-data to objects. A solution (I think) would be one *.hbm.xml-file per table an...

POJO to XML mapping in Java to avoid breaking XHR

Let's say I have a simple POJO class: public void Foo { public int a; public int b; public Foo() { a = 0; b = 1; } } Is there some library in JAVA which will give me XML like this: <List> <a value='0'/> <b value='1'/> </List> I have a XHR service but I have to manually "dump" each member to ...

Mapping python tuple and R list with rpy2 ?

Hello guys, I'm having some trouble to understand the mapping with rpy2 object and python object. I have a function(x) which return a tuple object in python, and i want to map this tuple object with R object list or vector. First, i'm trying to do this : # return a python tuple into this r object tlist robjects.r.tlist = get_max_ticks...

Hibernate : OneToMany mapping not based on PK ?

I have 2 entities/tables. One is a proper entity, let's call it data. It has a number of fields containing so-called "multilingual codes". The second table, code, contains the multilingual values themselves. Here is some example data : Data table id name continentCode countryCode ------------------------------------ 1 ...

How can I add stored function to Entity Framework

Hi to all. I'm trying to add a sql (stored) function to Entity Framework, but unsuccessfully. I tried with right clicking on a table in .edmx and "Function Import", but the function is not shown there, although I added it (updated model from the database). Does anyone have solution for this? ...