Hibernate version:
I'm using standard jboss 4.04 ga: it says
11:55:52,108 INFO [Version] Hibernate EntityManager 3.2.0.CR1
11:55:52,139 INFO [Version] Hibernate Annotations 3.2.0.CR1
11:55:52,155 INFO [Environment] Hibernate 3.2 cr2
I'm not in production yet.. but i'm worry about 10.000 (ten thousand) of users asking the seguent complex multi join query,
String ejbQuery = "select distinct entity from DataEvento as entity "
+ "left outer join fetch entity.configurazioneLocali as configurazioneLocaliDataEvento "
+ "left outer join fetch configurazioneLocaliDataEvento.locale "
+ "left outer join fetch entity.multiGeneres "
+ "left outer join fetch configurazioneLocaliDataEvento.ordinePostoPerConfigurazioneLocalis as ordiniPostoLocale "
+ "left outer join fetch ordiniPostoLocale.tipoTitoliPerOrdinePostoPerDataEventos as titoliPerOrdinePosto2 "
+ "left outer join fetch ordiniPostoLocale.ordinePosto "
+ "left outer join fetch titoliPerOrdinePosto2.tipoTitolo "
+ "left outer join fetch titoliPerOrdinePosto2.dataEvento "
+ "where entity.codice = :codice "
+ "and (titoliPerOrdinePosto2.dataEvento = entity)";
luckly i can consider quite static these data... so i think to cache the results: is it possible to cache a bunch of object directly in hibernate or jboss or i have to do it programmatically?
at
http://www.hibernate.org/hib_docs/entit ... ation.html
i see that's possible to set the cache by single entity... while i need to cache this results
if i have to do it by myself i do something like the PK to find the right object and the timestamp to define the object validity
Another question.... in my entity i have an association mapped by a column, can i have also the primitive value of this field? for example i got the association:
@ManyToOne(cascade={},
fetch=FetchType.LAZY)
@JoinColumn(name="id_FilePerOrdinePostoPerDataEvento", unique=false, nullable=true, insertable=true, updatable=true)
public FilePerOrdinePostoPerDataEvento getFilePerOrdinePostoPerDataEvento() {
return this.filePerOrdinePostoPerDataEvento;
}
but i'd like to have also
@Column(name="id_FilePerOrdinePostoPerDataEvento", unique=false, nullable=true, insertable=true, updatable=true, length=10)
public String getIdFilePerOrdinePostoPerDataEvento() {
return this.idFilePerOrdinePostoPerDataEvento;
}
is it possible????
thanks to all