charliem / OCM

An ORM layer for the Apache Cassandra web scale database
Apache License 2.0
20 stars 0 forks source link

LazyLoad #1

Closed ghost closed 14 years ago

ghost commented 14 years ago

Hi Charliem. Can you advice something to my design problem. In your example you have entity User. But in real life you need only username. Password you need only once during user login. So it's no reason to hold user password in object User (and in the Session at the end) It's very rough example but hoping you understand my question.

Does your project can help me? Should I create two entity User & UserWithPassword and map some fields to same columns?

Or my discourses is wrong?

Thanks, Andy.

charliem commented 14 years ago

Hi Andy,

Loading a couple of extra strings is usually not much of a performance issue. But it is possible to only load parts of a column family. Each column family has its own load method in the generated code.

In the example you can just load all the name and email fields by calling loadInfo method. So you can design your data model to assist the loading pattern.

Regards,

Charlie