Let's say I have a query that begins with the following projections:
SELECT t.term as term, count(g.id) as amount
This is raw sql, and I am using createSqlQuery on the Hibernate session object. What I'd like to do is take these projections and put them in an object that has a "term" and "amount" properties.
With HQL, we can use "sel...
Basically I am looking to be able to reuse model definitions to target both Doctrine models and JSON-Schema.
I don't care if it means defining it in a 3rd model language and having the ability to convert that to both yml and json-schema or if it is from json-schema -> yml as long as I have 1 place to update both of them.
...
Below an illustration of my project hierarchy
When i try to connect my file_name.java file to hibernate i'm getting these errors
Exception in thread "main" org.hibernate.HibernateException: Could not instantiate cache implementation
at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:64)
at org.hibernate.impl.Se...
Hello.
Somehow I can't figure out how to implement the following relations
using Doctrine 2 syntax:
I have Items and Shops. Each item has different price and different
quantity at each shop. So, I have Items table, Shops table and
ItemsAtShops table. How do I reflect the last one in Doctrine?
I guess I need to create ItemsAtShops enti...
Hello,
I m using Spring's HibernateDAOSupport class to handle my DAO.
my problem is that when I use getHibernateSupport().save(order) when order already exist in the database, it just update the database row instead of throwing some kind of Exception.
my Hibernate hbm.xml file is :
<hibernate-mapping>
<class name="com.shopping.db.Cust...
If I have this method in object class:
@OneToMany( fetch = FetchType.EAGER,
cascade = { CascadeType.ALL },
mappedBy = "object" )
@org.hibernate.annotations.Cascade(
{org.hibernate.annotations.CascadeType.SAVE_UPDATE})
@Column( nullable = false )
public Set<ObjectEntry> getObjectEntries() {
return this.objectEntries;
}
...
I am just a simple beginner with both NHibernate and WCF. I would like to use NHibernate as my ORM in the class library where my repositories are. I also need to use WCF to expose my business logic, and behind that my repositories, to the rest of the company.
Is there some good documentation on how to accomplish this task? Are there pit...
Ok I know "what X should I use" is very broad so let me narrow down our usage scenario. Basically, we should have been using an ORM a long time ago. Now though there is no way we can go through and rewrite every line of generated SQL Queries in our C# code. But we want to at least take a few steps in the right direction. So when we write...
I can't seem to figure out how I can select only distinct entries in Llblgen 2.6 self-service model
I essentially want this query.
select distinct City
from peopleTable
where *predicates*
I've got my PeopleCollection and I'm not sure if there's a distinct method I can call or argument I can pass to GetMulti().
...
jruby google app engine error message: Multiple keys in #<KeywordUser @user_id=1 @keyword_id=2>
Models: (attempting to implement has and belongs to many relationship)
class Keyword
include DataMapper::Resource
property :id, Serial # required for DataMapper
property :name, String # A varchar type string, for short strings
...
My problem is the same as described in [1] or [2]. I need to manually set a by default auto-generated value (why? importing old data). As described in [1] using Hibernate's entity = em.merge(entity) will do the trick.
Unfortunately for me it does not. I neither get an error nor any other warning. The entity is just not going to appear i...
Possible Duplicate:
Are there good reasons not to use an ORM?
I've just started learning what an ORM is and how it can help me save time and make applications more secure. Since this is new to me, after using ugly SqlCommands and whatnot in my C# code, this is the best thing since sliced bread.
However since I'm new I might n...
Can you, please, explain me the differences between the following database representatives, say, in PHP.:
ORM
DAO
DataMapper
ActiveRecord
TableGateway
Any examples would be appreciated.
...
Hi,
I'm looking for an easy-to-use and intergrate ORM for Wicket application. I was thinking about Hibernate. Is it a good choice? What are the possible problems with Wicket/Hibernate? Any other suggestions are welcome. Thanks for any help.
...
I am new to hibernate and I am having some trouble with the named query annotation. My code is as follows and is more or less generated by NetBeans
The BasicUser class:
package wmc.model;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Colu...
I have the following HBMs (the sample is purely fictional, so don't try to understand the business needs)
Class Document
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Document" discriminator-value="Document">
<id name="Id" type="long">
<generator class="native" />
</id>
<discriminator />
<p...
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...
I'm a .net developer by trade but I'm looking to expand to PHP. I really like what I've seen PHP can do. However I have been somewhat spoiled with data access in .net (such as LINQ) and how easy it is to make strongly type datasets. Are there such ways to do the same (or similar ) thinks for data access in PHP? A framework I'm unawar...
There has been a lot of talk about contra-revolutionary NoSQL databases like Cassandra, CouchDB, Hypertable, MongoDB, Project Voldemort, BigTable, and so many more. As far as I am concerned, the strongest pros are scalability, performance and simplicity.
I am seriously considering to suggest using some non-relational db for our next pr...
I have a problem with merging of objects using JPA. My code goes like this.
EntityTransaction entr = em.getTransaction();
entr.begin();
Query q = em
.createQuery("SELECT filterName FROM IbFilterName filterName where"
+ " filterName.filterId = 42352 ");
List<IbFilterName> filterNameList = q.getResultList();
for(IbFilterName fil...