I have a JSP/Spring application using Hibernate/JPA connected to a database. I have an external program that check if the web server is up every 5 minutes.
The program call a specific URL to check if the web server is still running. The server returns "SUCCESS". Obviously if the server is now, nothing is returned. The request timesout a...
Hi all,
My current workplace uses the standard Spring/Hibernate/JSP mix to serve content to its Flex client via XML. There are many ways in which the data is accessed, but the most prevalent one is via direct SQL calls to the database and a manual conversion to XML.
The trouble is that as the application grew bigger, the SQLs became mu...
Greeting ,
In my non-web application(using Spring,Hibernate), I parse a CSV file and populate db using following method.
handleRow() is called everytime a new raw is read from CSV file.
My domain model:
'Family' has many 'SubFamiliy'
'SubFamily' has many 'Locus'
a 'Locus' belongs to a 'Species'
Family<>SubFamily<>Locus...
Greetings I am developing a non-webapplication using Spring+Hibernate.
My question is how the HibernateDaoSupport handles lazy-loading , because after a call do DAO , the Session is closed.
Take a look at following psuedo-code:
DAO is like:
CommonDao extends HibernateDaoSupport{
Family getFamilyById(String id);
SubFamily getSubFamil...
When to use each? To what do they map in the database?
...
Hello all
correct me if i wrong but i don't know any solution in c++ that is similar to java persistent hibernate
is there ?
...
So, I'm pretty new to Hibernate and I have a problem.
I have an abstract class (the super-class, class Super), and 5 subclasses which should use the proprieties from the class Super and add a new propriety (a new column)
So how can I do this? Should I extend the class Super from java, or it's enough to join the classes using a JPA anno...
i have 2 table:
message(id, name, content, channel_number) // channel_number is foreign key
channel(number, name) // number is primary key
i use hibernate to map 2 table
java class
public class Message {
private Integer id;
private String name;
private String content;
private Channel channel;
}
public class Channel {
priv...
I found this example in jboss's documentation.
select new Family(mother, mate, offspr)
from DomesticCat as mother
join mother.mate as mate
left join mother.kittens as offspr
Where does the Family class come from. Do I need to import somewhere, or to use its fully qualified class name?
...
Hi
I have a table which contains huge data. I want to add hibernate automatic versioning to this table. But adding a not-null column to this table for versioning is very expensive due to huge data. Is there a workaround so hibernate can work with nullable column? Currently hibernate gives NPE because it tries to increment a null value.
...
UPDATE: EXAMPLE TO CLARIFY
I'm going to put an example of what's happening just to clarify the situation in my Spring + Hibernate application.
Imagine I have this two entities (suppose getters and setters exists too)
@Entity
public class Class1(){
private Integer id;
@OneToOne
private Class2 object2;
}
@Entity
public class Clas...
I have a list of items. Each item has set of categories. I want to grab all the items of a specific category. This part is simple. The part I am having problems with is getting my query to return the item with all of its categories, not just the one I am filtering on.
session.createCriteria(Item.class)
.createAlias("categories"...
I have Category class containing list of products. Like this:
public class Category{
...
@0neToMany
@JoinColumn("category_id")
List<Product> products;
public List<Product> getProducts();
...
}
When I call getProducts() I want to lock returned collection so that other transaction could not modify it while current one isn't comm...
Hi,
In my Grails app I have a domain class that has a property
SearchPrivacy searchPrivacy = SearchPrivacy.PUBLIC
where SearchPrivacy is an enum
enum SearchPrivacy {
PRIVATE('pr'), PUBLIC('pu');
final String id
SearchPrivacy(String id) {
this.id = id
}
static getEnumFromId(String id) {
values()...
Is there a way of forcing the hbm2java goal of hibernate3 maven plugin to generate java classes with hibernate annotations instead of ejb3 annotations? I really do not need ejb/jpa, and hibernate annotations would suit me better because of the better integration with grails.
...
It's possible to use @TypeDefs annotation to define short type name for a UserType. But how to define it for entire application?
...
In the standalone application(single threaded command line tool) I am developing ,I use Spring +Hibernate.
It has DAO and Service layers and for DAOs I use HibernateDAOSupport.
The collections in domain model are lazy-loading.
Since for lazy-loading I need to keep the Session opended,I open session at start of my application using:
Hib...
I'm looking for resources showing how to integrate MongoDB with Hibernate (preferably from within spring) so that I can switch between a RDBMS and a NoSql alternative: does anyone have experience doing this?
...
I have a flex form which has two httpservice.one which accesses data from the servlet and one which stores data into another servlet.
Firstly when im accessing the data from the servlet that is working and the storing part is also working..so when i again call the access servlet im not getting the updated display..the access servlet is n...
I have legacy oracle db with a sequence named 'PRODUCT_ID_SEQ'. And here the mapping of Product class for which I need generate correct ids:
public class Product {
@GeneratedValue(strategy = GenerationType.SEQUENCE,
generator = "etailerRaw_seq")
@SequenceGenerator(name = "etailerRaw_seq",
...