6 Replies Latest reply on Mar 26, 2007 10:50 AM by Christian Pietsch

    Mapping String attribute in EntityBean to CHAR(size) in DB

    Henning Knüppel Newbie

      I have a composite PK class that consists of {int, int, String, String}.
      Both attributes of type String are mapped to CHAR(size) instead of VARCHAR2(size) in an Oracle DB.

      My Problem:
      The EntityManager's
      find(Class entityClass, Object primaryKey)
      method returns null instead of an EntityBean.

      It all works if I handcode my EJBQL and insert the two Strings with trailing white spaces to match the size of the CHAR-Colums in the DB.

      This is somewhat strange because a SQL select statement works fine without supplying trailing white spaces in the where clause.

      Any suggestions other than changing to VARCHAR2??