extending a table from KRIM (specifically KRIM_ENTITY_NM_T)

3 views
Skip to first unread message

Berkoff, Alexis (Alex) Contractor, eDataTech

unread,
Mar 9, 2018, 1:52:18 AM3/9/18
to kc.techni...@kuali.org

Hello all –

 

I have another question for the group.  2 in a row…  J

Thank you to Ron G for answering my previous question on the side.

 

So, I am confronted with another task that I have never done in my 5 years of working with KC.

I need to extend the class that represents the KRIM_ENTITY_NM_T table.

Specifically, I need to add a couple new columns to it. 

I’ll also need to modify the WSDL / SOAP WS so that I can access those fields.

 

I see that in the version of rice that I’m using (2.1.5) there is a groovy file:

org.kuali.rice.kim.impl.identity.name.EntityNameBo.groovy

 

I’ve add my 2 fields there along with the respective getters.

 

I’ve added the columns to the table itself and I’ve modified the repository.xml file.

 

However, I’m still getting the following error when I attempt to log into the system:

 

2018-03-08 22:25:02,681 [http-8080-3] u:/d: FATAL org.kuali.rice.core.framework.persistence.jta.KualiTransactionInterceptor - Exception caught by Transaction Interceptor, this will

cause a rollback at the end of the transaction.

org.springmodules.orm.ojb.OjbOperationException: OJB operation failed; nested exception is org.apache.ojb.broker.metadata.MetadataException: Can't find member 'adLevel' in class

class org.kuali.rice.kim.impl.identity.name.EntityNameBo

 

That’s what the addition in the EntityNameBo.groovy class looks like:

 

    @Column(name = "AD_LEVEL")

    Integer adLevel;

 

    @Column(name = "HOME_AD_LEVEL")

    Integer homeAdLevel;

 

As far as the WS is concerned –

 

It appears that all I need to do is modify the EntityName.java and EntityNameContract.java classes to add those 2 new fields.

Obviously I’ll regenerate the client stubs using the new WSDL after building…but I’m still getting stuck on the first step of adding those 2 fields to the entity class…

Anything else I would need to do here to update the WS or did I get this part right?

 

Any help/recommendation would be appreciated.

 

Thanks.

Alex

Berkoff, Alexis (Alex) Contractor, eDataTech

unread,
Mar 9, 2018, 1:57:39 AM3/9/18
to kc.techni...@kuali.org

PS –

 

I don’t mind overwriting the rice class either…in fact that’s what I meant originally…

So, extending the class is the wrong word here although if the only way to go about this is truly “extending” – I’m open to that option too.

 

Alex

--
You received this message because you are subscribed to the Google Groups "KC Technical User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kc.technical.co...@kuali.org.

Ken Geis

unread,
Mar 9, 2018, 2:01:30 AM3/9/18
to Berkoff, Alexis (Alex) Contractor, eDataTech, kc.techni...@kuali.org
I'm seeing that you added JPA annotations and are getting OJB errors. It looks like EntityNameBo is mapped with JPA, so why is there an OjbOperationException in your stack trace?


Ken

Berkoff, Alexis (Alex) Contractor, eDataTech

unread,
Mar 9, 2018, 11:23:04 AM3/9/18
to Ken Geis, kc.techni...@kuali.org

Ken –

 

Good point.

I had added the following to the repository.xml in my overlay:

  

 <class-descriptor class="org.kuali.rice.kim.impl.identity.name.EntityNameBo" table="KRIM_ENTITY_NM_T">

                …

 

        <field-descriptor name="adLevel" column="AD_LEVEL" jdbc-type="INTEGER" />

        <field-descriptor name="homeAdLevel" column="HOME_AD_LEVEL" jdbc-type="INTEGER" />

 

                …

</class-descriptor>

 

I removed it.

The new error without the above OJB mapping:

 

2018-03-09 08:18:36,870 [http-8080-3] u:/d: FATAL org.kuali.rice.core.framework.persistence.jta.KualiTransactionInterceptor - Exception caught by Transaction Interceptor, this will

cause a rollback at the end of the transaction.

java.lang.AbstractMethodError: org.kuali.rice.kim.impl.identity.name.EntityNameBo.getAdLevel()Ljava/lang/Integer;

 

So…

To add 2 new columns to the table, do I modify the JPA or the OJB or both?

 

Alex

Ken Geis

unread,
Mar 9, 2018, 12:36:29 PM3/9/18
to Berkoff, Alexis (Alex) Contractor, eDataTech, kc.techni...@kuali.org
It looks to me like the JPA annotations are for Rice getting ready to use JPA in a later release. So they're probably not necessary but won't hurt. I would put the mapping in the repository.xml.

You say you're doing an overlay. Just to eliminate the obvious, are you sure that your EntityNameBo.groovy class is getting compiled as part of your build?


Ken

Berkoff, Alexis (Alex) Contractor, eDataTech

unread,
Mar 10, 2018, 8:12:22 PM3/10/18
to Ken Geis, kc.techni...@kuali.org

It appears that the groovy class for EntityNameBo is getting relevant.

I’ve added the OJB mappings everywhere I needed to…

I’ve created the beans…

I’ve updated the tag files…

 

The application is failing when the EntityName Builder is attempting to set my new member variable upon me logging in.

The exact error is this:

 

2018-03-10 15:59:44,350 [http-8080-3] u:/d: FATAL org.kuali.rice.core.framework.persistence.jta.KualiTransactionInterceptor - Exception caught by Transaction Interceptor, this will

cause a rollback at the end of the transaction.

org.springmodules.orm.ojb.OjbOperationException: OJB operation failed; nested exception is org.apache.ojb.broker.metadata.MetadataException: Can't find member 'adLevel' in class class

org.kuali.rice.kim.impl.identity.name.EntityNameBo

 

I’ve done an exhaustive search for EntityNameBo in my version of RICE and the only class that comes up is that groovy file.  It must be the one that is used here…There is no EntityNameBo.java!

The thing that has me puzzled is that I’ve overridden the EntityNameBo in my overlay:

org.kuali.rice.kim.impl.identity.name.EntityNameBo.groovy

 

….

 

    @Column(name = "AD_LEVEL")

    Integer adLevel;

 

    @Column(name = "HOME_AD_LEVEL")

    Integer homeAdLevel;

 

….

 

However, the overlay must be ignoring this file since it is not aware of my changes…

 

Is this because anything in the groovy package is ignored by the overlay?

 

Or is this because of the way groovy files work? 

I don’t know much about groovy – just that’s a scripting language that sits on top of Java and that’s dynamically complied to bytecode.

 

My thoughts at this point are to modify the module that I need to customize directly at the jar level – by editing the groovy file there… maybe then my changes will get picked up?

This seems like way overkill…

 

Thoughts from anyone in the community?

Has anyone added columns to their embedded version of KRIM before?

 

Thanks in advance.

Reply all
Reply to author
Forward
0 new messages