>
> On Sun, May 16, 2010 at 4:39 AM, Anton Podviaznikov
> <[email protected]> wrote:
>
> > I'm stack with Neo4j support now. I know that there is extension (I guess
> > this?
> http://dscm.ops4j.org/git/gitweb.cgi?p=qi4j-extensions.git;a=tree;f=entitystore-neo4j;hb=396075ff031b263fa81d7fb870919a21d741c4be
> ?)
> > but it uses outdated version of Neo4j.
>
> I will leave the Neo4j specific questions to someone from Neo
> Technology who would know more about it.
>
> > Does somebody has few more samples of using this db?
>
> In principle, once the assembly is done, there is no 'leakage' of Neo
> into the Qi4j world and there are no "Neo4j specific" samples to make.
>
>
> Cheers
> --
> Niclas Hedhman, Software Developer
> http://www.qi4j.org - New Energy for Java


Niclas, thanks for your answer.

I have few more question about the Qi4j. If you know some sample that I
missed - just tell me:)

1. I created sample application. We have company domain model. I want to add
company and view the list of companies.

I have following code:

        public void addCompany(String name)
        {
            final UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
            try
            {
                final EntityBuilder<Company> builder =
uow.newEntityBuilder(Company.class);
                final Company prototype = builder.instance();
                prototype.name().set(name);

                final Company company = builder.instance();

                System.out.println(company.name());
            }
            finally
            {
                try
                {
                    if(uow!=null)uow.complete();
                }
                catch (UnitOfWorkCompletionException e)
                {
                    debug.debug(Debug.HIGH, "Exception during UOW complete.
See: " + e.getMessage());
                }
            }
        }

Is it enough to store entity or I missed something?

Because I have next method:

        public Query<Company> findAll()
        {
            final UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
            try
            {
                return qbf.newQueryBuilder(Company.class).newQuery(uow);
            }
            finally
            {
                try
                {
                    if(uow!=null)uow.complete();
                }
                catch (UnitOfWorkCompletionException e)
                {
                    debug.debug(Debug.HIGH, "Exception during UOW complete.
See: " + e.getMessage());
                }

            }
        }


and it retus empty list.

2. Another question regarding UnitOfWork. DO I use tham correctly? What is
the pattern, when I should create new or use current?

Thanks for your help.


Best regards,

Anton Podviaznikov
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to