Re: String-with-number sort and insert order preservation

2010-02-02 Thread Florin T.PATRASCU
Hi Šabo, I don't have a pure Cayenne answer, but in case you can add an extra field to your table, then you can write a simple program to convert your IP addresses to numbers and save the numbers to the newly added field. Here is a simple Java method I am using to convert IPV4s to a long:

Re: String-with-number sort and insert order preservation

2010-02-02 Thread Joe Baldwin
Marek, > 1) Is there any way to sort varchar fields which happen to numbers, more > precisely ipv4s? > query.addOrdering(Ip4Address.IP_ADDRESS_PROPERTY, SortOrder.ASCENDING); > This of course sets the hundreds as first in line, any tips on some > custom sorting? I have two ideas: 1.You could cre

Re: String-with-number sort and insert order preservation

2010-02-02 Thread Aristedes Maniatis
On 3/02/10 11:45 AM, Marek Šabo wrote: Hi all, I would like to ask you two questions: 1) Is there any way to sort varchar fields which happen to numbers, more precisely ipv4s? query.addOrdering(Ip4Address.IP_ADDRESS_PROPERTY, SortOrder.ASCENDING); This of course sets the hundreds as first in li

String-with-number sort and insert order preservation

2010-02-02 Thread Marek Šabo
Hi all, I would like to ask you two questions: 1) Is there any way to sort varchar fields which happen to numbers, more precisely ipv4s? query.addOrdering(Ip4Address.IP_ADDRESS_PROPERTY, SortOrder.ASCENDING); This of course sets the hundreds as first in line, any tips on some custom sorting? 2)

Re: Class is not mapped

2010-02-02 Thread Andrey Razumovsky
Hi, What version of Cayenne are you trying? To check if everything's mapped well, open cayenne.xml with Cayenne Modeler, find ObjEntity (green icon) Artist and make sure that org.example.cayenne.persistent.Artist is specified as class name. But, if you hadn't changed anything in tutorial project,

Class is not mapped

2010-02-02 Thread jmp5167
Hello, I am new to using Cayenne so I decided to first start by going through the tutorial. All went fine until I tried to build my project. I get an error that says: Exception in thread "main" java.lang.IllegalArgumentException: Class is not mapped with Cayenne: org.example.cayenne.persistent

Re: BUG: Cayenne Modeler

2010-02-02 Thread Joe Baldwin
Andrus, One more data point (based on another test): I just change the "Delete Rule" associated with the three ObjEntities and then tried to save the project. The dialog popped up: Title: Synchrnize ObjEntity with DbEntity CheckBox value: checked

Re: Cayenne code generation - pointers requested

2010-02-02 Thread Mike Kienenberger
I've written a great deal of templates (generated entire CRUD web apps straight from the model in struts and JSF) which I run from ant cgen, but I can't make them available. If you post specific questions, I can answer them. Basically, you need to choose whether you want to generate one file per

Re: BUG: Cayenne Modeler

2010-02-02 Thread Joe Baldwin
Kevin, > You need a foreign key in your database table. > You need a foreign key attribute in your DbEntity. You also need a > DbRelationship. > You do not need a foreign key attribute in your ObjEntity -- you only > need the (Obj)relationship. OK. Sorry, I think I misunderstood one of the prev

Re: BUG: Cayenne Modeler

2010-02-02 Thread Andrus Adamchik
On Feb 2, 2010, at 4:53 PM, Joe Baldwin wrote: Still, I have created about 15-20 relationships with this same design and have never seen this dialog or this error before. You are the expert, of course, however if I am to help out by reporting a problem I believe it would be helpful to firs

Re: BUG: Cayenne Modeler

2010-02-02 Thread Mike Kienenberger
Hi Joe, You need a foreign key in your database table. You need a foreign key attribute in your DbEntity. You also need a DbRelationship. You do not need a foreign key attribute in your ObjEntity -- you only need the (Obj)relationship. If any of the above terms are unclear, let me know, and I'll

Re: BUG: Cayenne Modeler

2010-02-02 Thread Joe Baldwin
Kevin, I think we might have a communication problem. First of all let me say that I will follow any instruction the team requests in order to solve this problem. Cayenne is one of the best pieces of software I have ever used. Also, I have my own methodology when analyzing a problem. The fir

Re: BUG: Cayenne Modeler

2010-02-02 Thread Joe Baldwin
Andrus, Here is the info that your requested: > * Which version of the Modeler are you using? 3.0RC1, Application (Universal), Java Hotspot 64 bit server VM 1.6.0_17 on Mac OS 10.6.2 > * Are you using a platform-specific build provided by Cayenne, or are you > running it yourself with java?

Re: BUG: Cayenne Modeler

2010-02-02 Thread Kevin Menard
Hi Joe, Please find comments in-line. On Tue, Feb 2, 2010 at 9:09 AM, Joe Baldwin wrote: > The behavior by an app in which it freezes for about 3-4 minutes and then > generates an out-of-memory-error is typically associated with an infinite > loop. Increasing the available memory to an app do

Re: BUG: Cayenne Modeler

2010-02-02 Thread Andrus Adamchik
Hi Joe, (Disclaimer: I also haven't looked at the code involved yet). An OutOfMemoryError can be associated with many kinds of conditions. You can have an infinite loop not causing an OutOfMemory. And also OutOfMemoryError is by itself often causing a UI freeze, as the JVM tries to free up

Re: BUG: Cayenne Modeler

2010-02-02 Thread Joe Baldwin
The behavior by an app in which it freezes for about 3-4 minutes and then generates an out-of-memory-error is typically associated with an infinite loop. Increasing the available memory to an app does nothing to analyze the problem. It is more likely to be associated the the CM attempting to "r

Re: BUG: Cayenne Modeler

2010-02-02 Thread Bryan Lewis
Sure, but you can run the modeler with an increased heap size, like java.exe -Xmx512m -jar CayenneModeler.jar On Mon, Feb 1, 2010 at 11:25 PM, Joe Baldwin wrote: > The CayenneModeler crashed not my app. > > > > > On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote: > > > Hi Joe, > > > > It looks l