Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 5.1.2, 5.2.3, 6.0.5 GA
-
Fix Version/s: --Sprint - SP, 6.0.6 GA, 6.1.0 CE RC1
-
Component/s: Tools > Service Builder
-
Labels:None
-
Environment:Any
-
Branch Version/s:5.1.x, 5.2.x, 6.0.x
-
Backported to Branch:Committed
-
Similar Issues:
Description
Primitive wrapper types like Boolean and Integer are legal in service definition.
But when any of the primitive wrappers are used as types for columns in a portlet or a web plugin's service, read fails with no errors and write fails with hibernate "MappingException: unknown entity".
This is because the type is not generated in the hbm mapping file when type is not primitive. This causes Hibernate to use reflection which fails because the hibernate/portal classloader does not have the portlet's entity class.
So type needs to be generated even for primitive wrappers.

Sorry for cloning this issue, maybe this is not correct.
But this one seems also the reason for: http://issues.liferay.com/browse/LPS-10194 or this similar problem with ServiceBuilder
Even with SDK 6.0.5 and the latest Portal trunk (21.08.2010), there is a problem when generating services with primary key and NON primitive types.
The Persistence class will not compile after building the service
Example:
<column name="herstellerNr" type="int" primary="true" id-type="increment" />
public Customer remove(Serializable primaryKey)
{ return remove(((Integer)primaryKey).intValue()); }throws NoSuchModelException, SystemException
No Error.
<column name="herstellerNr" type="Integer" primary="true" id-type="increment" />
{ return remove(((Integer)primaryKey).IntegerValue()); }public Customer remove(Serializable primaryKey)
throws NoSuchModelException, SystemException
Error: The method IntegerValue() is undefined for the type Integer
<column name="herstellerNr" type="Long" primary="true" id-type="increment" />
{ return remove(((Long)primaryKey).LongValue()); }public Customer remove(Serializable primaryKey)
throws NoSuchModelException, SystemException
Error: The method LongValue() is undefined for the type Long
Same Problem also affects the methods "findByPrimaryKey" and "fetchByPrimaryKey" in the persistence-class