aminos boss

Greenhorn
+ Follow
since Mar 13, 2018
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by aminos boss

Dave Tolls wrote:Thanks!

And can you show what you are seeing, and what the row data actually is in the database?

That mapping looks fine to me, which is a good start.

How are you viewing the result?
I can't see any logging in there?
Is it some other front end displaying it?




i'm using the debug mod of eclipse i don't use the wiew mode
6 years ago


//hbm:






6 years ago
DAO class:

public class CacheObjConfigHibernateDao
/*    */   extends HibernateDaoSupport
/*    */   implements ICacheObjConfigDao
/*    */ {
///* 19 */   private static AonLogger logger = (AonLogger)AonLogger.getInstance(CacheObjConfigHibernateDao.class.getName());
/*    */  
/*    */
/*    */
/*    */   public List findAllCacheObjConfig()
/*    */     throws ComportementException
/*    */   {
/*    */     try
/*    */     {
/* 28 */       return getHibernateTemplate().find("from CacheObjConfig");
/*    */     }
/*    */     catch (Exception e)
/*    */     {
///* 32 */       logger.error(e);
/* 33 */       throw new ComportementException();
/*    */     }
/*    */   }
/*    */ }


hbm class

<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
       "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
       "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">


<hibernate-mapping>
   <class
       name="fr.aon.esolutions.cache.CacheObjConfig"
       table="AONSANTE_CACHEOBJCONFIG"
       dynamic-update="false"
       dynamic-insert="false"
   >

       <id
           name="id"
           column="ASCA_NUM_ID"
           type="java.lang.Long"
       >
           <generator class="sequence">
            <param name="sequence">AONSANTE_SQ_CACHEOBJCONFIG</param>
           </generator>
       </id>

       <property
           name="mapcle"
           type="string"
           update="true"
           insert="true"
           column="ASCA_LIB_MAPCLE"
           length="20"
       />

       <property
           name="nommethode"
           type="string"
           update="true"
           insert="true"
           column="ASCA_LIB_NOMMETHODE"
           length="40"
       />

       <property
           name="nomservice"
           type="string"
           update="true"
           insert="true"
           column="ASCA_LIB_NOMSERVICE"
           length="40"
       />

       <property
           name="parametre"
           type="string"
           update="true"
           insert="true"
           column="ASCA_LIB_PARAMETRE"
           length="30"
       />

       <property
           name="type"
           type="string"
           update="true"
           insert="true"
           column="ASCA_LIB_TYPE"
           length="10"
       />

       <property
           name="priorite"
           type="java.lang.Integer"
           update="true"
           insert="true"
           column="ASCA_NUM_PRIORITE"
       />

       <property
           name="code"
           type="string"
           update="true"
           insert="true"
           column="ASCA_LIB_CODE"
           length="20"
       />

       <!--
           To add non XDoclet property mappings, create a file named
               hibernate-properties-CacheObjConfig.xml
           containing the additional properties and place it in your merge dir.
       -->

<component name="ifp" class="fr.aon.esolutions.metier.commun.InfoPersistance">
<property name="idcr" column="ASCA_NUM_IDCR"/>
<property name="idupd" column="ASCA_NUM_IDUPD"/>
<property name="datcr" column="ASCA_DAT_DATCR"/>
<property name="datupd" column="ASCA_DAT_DATUPD"/>
</component>

   </class>

</hibernate-mapping>

entity class:

/*     */ package fr.aon.esolutions.cache;
/*     */
/*     */ import fr.aon.esolutions.metier.commun.ESolutionsBaseObject;
/*     */ import java.io.Serializable;
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */
/*     */ public class CacheObjConfig
/*     */   extends ESolutionsBaseObject
/*     */   implements Serializable
/*     */ {
/*     */   private Long id;
/*     */   private Object service;
/*     */   private String nomservice;
/*     */   private String nommethode;
/*     */   private String parametre;
/*     */   private String type;
/*     */   private String mapcle;
/*     */   private String code;
/*     */   private Integer priorite;
/*     */  
/*     */   public CacheObjConfig()
/*     */   {
/*  39 */     this.id = new Long(-1L);
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */
/*     */   public String getCode()
/*     */   {
/*  48 */     return this.code;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public Long getId()
/*     */   {
/*  56 */     return this.id;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public String getMapcle()
/*     */   {
/*  64 */     return this.mapcle;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public String getNommethode()
/*     */   {
/*  72 */     return this.nommethode;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public String getNomservice()
/*     */   {
/*  80 */     return this.nomservice;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public String getParametre()
/*     */   {
/*  88 */     return this.parametre;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public Integer getPriorite()
/*     */   {
/*  96 */     return this.priorite;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public Object getService()
/*     */   {
/* 104 */     return this.service;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public String getType()
/*     */   {
/* 112 */     return this.type;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public void setCode(String string)
/*     */   {
/* 120 */     this.code = string;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public void setId(Long long1)
/*     */   {
/* 128 */     this.id = long1;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public void setMapcle(String string)
/*     */   {
/* 136 */     this.mapcle = string;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public void setNommethode(String string)
/*     */   {
/* 144 */     this.nommethode = string;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public void setNomservice(String string)
/*     */   {
/* 152 */     this.nomservice = string;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public void setParametre(String string)
/*     */   {
/* 160 */     this.parametre = string;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public void setPriorite(Integer integer)
/*     */   {
/* 168 */     this.priorite = integer;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public void setService(Object object)
/*     */   {
/* 176 */     this.service = object;
/*     */   }
/*     */  
/*     */
/*     */
/*     */
/*     */   public void setType(String string)
/*     */   {
/* 184 */     this.type = string;
/*     */   }
/*     */ }

6 years ago

Dave Tolls wrote:Are the columns empty in the database?



no
6 years ago
Hi,
I'm using Hibernate3 and the org.springframework.orm.hibernate3.support.HibernateDaoSupport
my problem is :

getHibernateTemplate().find("from myEntity");



--> result Liest<myEntity>

i get all atrubutes but String are empty ('');

so the connexion to the DB is ok, sessionFactory is ok, get varchar2 column from oracl is ok




6 years ago