Problem: Entities (say Users) are showed in a paginated fashion in the UI. The UI also shows a checkbox against each entity, so that it is possible for the admin to multi-select users and delete them. It is quite natural that this entity is associated with many other entities via a foreign key relationship (say Purchase Orders created by...
I guess it's a good practice to capture auditable fields to track what happened to a particular entity (say createdBy, creationDate, modifiedBy, modifiedDate)
I am assuming if an object is never modified it makes sense just to capture the following auditable fields for an SNMPv3 event (say createdBy, creationDate)
I am assuming if an ...
Related to this question
Premise:
These are my assumptions, based on my reading, experience and understanding, they may be wrong, if they are, please comment and I'll edit the question.
Query cache is good mostly along with 2nd level cache
Query cache caches the identifiers results of queries + parameters
Query cache is risky if the...
If I have a mapping like this:
<class name="Library" table="Libraries">
...
<dynamic-component name="Annotations">
<property name="LibraryResolver.AlgorithmVersion" column="`LibraryResolver.AlgorithmVersion`" type="Int32" />
</dynamic-component>
</class>
How should I write HQL or Linq-to-NHibernate query for all libraries wh...
General case: first table represents one-side, second table represents many-side. Third table serves as a link between the two.
My case: first and second tables are the same. Third table serves as a link between all pairs of tables which have one-to-many relationship. This third table has additional field (String) which contains inform...
I have two objects Mat and MatImage, parent and child resp. The primary key of MatImage is the id of Mat and they are join by one to one relationship.
If I understand bidirectional relation correctly, the child object would know about the parent if I do something like matImage.setMat(mat). I would think the primary key would be filled ...
I am not able to save the many to one composite foreign key value.
PricingSheetFeeLineItem has one-to-many relation with SaleObjectPricingSheet. saleObjectPricingSheet has composite primary key. When I called session.saveOrUpdate(aPricingSheetFeeLineItem), the value for saleObjectPricingSheet is not able to be caught by hibernate so the...
Hi,
I've implemented a computed property to my configuration which works fine if I'm using HQL only. Sadly there are places where SQL-Queries are executed which I can't build into HQL. Am I facing a bug or just doing something wrong?
<property name="customerNr" type="int" insert="false" update="false" lazy="false">
<formula>
(SELECT DI...
The question is in the title.
Some explanation: I can't implement necessary mapping. But I can get all necessary data using queries in DAOs. So, I want to insert that data manually to my entity in DAOs findAll () method.
But JPA treats all entity's fields as persistent attributes and adds them to generated sql-queries. Of course, I get...
I have a hibernate Usertype something like this:
public class UUIDHibernateType implements UserType
{
private static final int[] SQL_TYPES = new int[] { Types.CHAR };
public int[] sqlTypes ()
{
return SQL_TYPES;
}
// ...
}
The problem I have is, that hibernate generates a sql script with the types CHAR(1)...
I have a piece of maintenance code that should grant select privileges to a certain user at certain points of time:
grant select on A_DB.A_TABLE to READ_ONLY_USER;
I want to do this for all tables. I could use select * from tab in Oracle or show tables in MySQL to get the complete list and then move on like that.
But since I already ...
All I know about this exception is from Spring's documentation and some forum posts with frostrated developers pasting huge stack traces, and no replies.
From Spring's documentation:
Thrown when an attempt to commit a transaction resulted in an unexpected rollback
I want to understand once and for all
Exactly what causes it?
...
If I put the wrong connection URL in my hibernate.cfg.xml file, I want to be able to detect it and terminate gracefully, but I can't figure out how; it just hangs indefinitely on buildSessionFactory() during the hibernate initialisation procedure:
SessionFactory sf = new AnnotationConfiguration().configure().buildSessionFactory();
It'...
Hello
I am using Glassfish v2, Hibernate with Annotations+EntityManager and Postgresql 8.4.
I am also using on top HibernateSpatial and PostGis.
It works fine to persist entities with spatial properties ( com.vividsolutions.jts.geom.Point ) into the Postgis database.
However, when trying to fetch objects using myEntityManager.find(MyCl...
I'm a java newbie, want to test out some hibernate goodies!
I have netbeans installed, and I included the Hibernate libraries.
I then created a new package named Model.
I will drop my Class and xml config files in there.
Do I need a special library to connect to sql server? (windows machine)
...
I downloaded microsfot's jdbc driver, and I am not sure what the connection.url should be?
<property name="connection.driver_class">org.microsoft.sqlserver.jdbc</property>
<property name="connection.url">jdbc:</property>
..
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
i configured sqlexpress to wor...
How can I have each call to save commit to the database?
I don't want to, at each interation of a loop that I am in, to call commit and then restart the transaction.
for my application, just having a commit at each session.save is fine.
...
I am using hibernate, and my classes property is a string, and my mapping doesn't have any type information, ie:
<property name="html" />
I am storing a web page in the html database column, and for some reason the entire page isn't saving, it gets cut off part way.
I outputed the value of the property to console and it does outpu...
Hi.I have a j2ee application using hibernate with annotation. How do I annotate the Id field in my pojo class to set it as auto increment or auto generated. and in adding the bean do I leave that field in my bean null?
...
(connected to db call abc)--->datasource1 ---> LocalSessionFactoryBean --->transactionManager1
(connected to db call abc)--->datasource1----->AnnotationSessionFactoryBean -->transactionManager2
the reason i have 2 sessionfactory is because one is used by 3rd party osworkflow library and latter use by my application
since both are co...