Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!

Craig Dumolien

Greenhorn
+ Follow
since Nov 07, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Craig Dumolien

Thanks for the point in the right direction. That worked great.
12 years ago
I was thinking I would just be able to use the file protocol. I'm not sure. We haven't done anything like this before. From what I've seen, I think I should be able to use a URL object with the file protocol and set my username and password as an authorization on the RequestProperty.
12 years ago
I have a java application where I need to create a file, without an extension, in code and write it to a different server on another network. Our company currently is on 2 networks. Both servers are Windows. The server I need to write to will need a user name and password. What is the best way to do this? Examples would be helpful.
12 years ago
Thanks for the input. That fixed it. The code I actually used is below. After getting the OrderLine, every other object I need to reference is one-to-one.

I have a domain object Order, which has an List of OrderLine objects withing OrderLine, I have another object called Product which has fields I need to be able to search on.

I currently have Hibernate set up to pull all the Product and OrderLine data, when an Order is requested. I like this. However, when using criteria I thought I should be able to set this up like,

but I get an Exception: org.hibernate.QueryException: could not resolve property: orderLines.product.customerProductId of: com....domain.Order



Is my notation wrong? If I just do a search on the poNum (which resides on the Order object), the search works fine. It only has problems when I go down to the OrderLine and Product level.

Thanks for the help.
I'm using Hibernate as my dao. I have a child table (AUTHORITY) which Hibernate will delete from, but will not insert into. From my logs, it isn't even trying to insert into the table when I insert/update into my parent table (USERS). The tables are getting created the way I want and my classes are getting created the way I want. I perfer that my child class not have visibility to the parent, through the username column.

Other info: Happening with MySQL and DB2 databases; Weblogic Server 8.1.6, Tomcat 5.5 and Tomcat 6.0; Java compile version 1.4.2_11

I'm guessing I have something wrong in my mapping of the USERS table, since that is the parent. I've tried different combinations of the bags properties inverse and cascade, but nothing I've tried is working. I've even tried to use a set instead of a bag and that has not been successful.

Please let me know if there is any other information which would be helpful

Thanks for any help.


My parent table mapping (USERS):


My child table mapping (AUTHORITY):

Sorry about the post being in the wrong topic.

That worked like a charm. Thanks
I need to create textarea objects on the fly. Below is the code I'm using to do that. However, I also need to use the events onkeydown and onkeyup to implement a textarea counter, of 250 characters. How/Can do I add the event handlers to my createElement code?

var textarea = document.createElement('TEXTAREA');
textarea.setAttribute('name', 'headerNote');
textarea.setAttribute('id', 'headerNote');


Thanks for the help.
I have inherited an applet, which in the past has allowed the user to FTP image files to and from the internal server. Recently, the server was put behind a firewall, but is still on the intranet. Since it is behind the firewall, I need to start using SFTP for the file transfers. Does anyone have any suggestions of code to use. As a side note, purchasing softeware for this purpose will not be an option, as the app will probably be killed within 18 months and the frequency of the upload/downloads is minimal.

Thanks for any suggestions and help.
14 years ago
I've had our DBA change the data type to NUMERIC, however, with DB2, there is no difference between NUMERIC and DECIMAL. When the table gets created it is still created as DECIMAL. I also had the DBA change the precision to 6 with a scale of 2. So, in the database, the column in question shows as DECIMAL(6,2) currently. I have no changes in functionality after these changes. Also, I tried to set the type as double and Double, before my original post, and I then received the same error, except that instead of "numeric(15,2)" is read as "double". Do you have any other suggestions?
I'm getting the following error when deploying my code. I think it is a problem with the mapping, but I don't know what's wrong with it. I've included my mapping file, database create so you know how the table was created, a domain object snipet, and the Hibernate properties I have set. I'm using xdoclet2 to create the mapping file. I'm running this on Weblogic 8.1.6, Windows XP (development environment) and DB2 8.x. I've tried this while using double and Double as the types in the domain object, and I get the same error, except "numeric(15,2)" was replaced with "double". Any ideas what I've done wrong?


error
org.hibernate.HibernateException: Wrong column type: RATE, expected: numeric(15,2)
at org.hibernate.mapping.Table.validateColumns(Table.java:251)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1007)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)


mapping
<hibernate-mapping>
<class table="PROJECT_FINANCE_RATE_EMPLOYEE" name="com...FinanceRateEmployee">
<composite-id unsaved-value="none" name="financeRateEmployeeID" class="com...FinanceRateEmployeeID">
<key-property name="costCenter" column="COST_CENTER"/>
<key-property name="effectiveDate" column="EFFECTIVE_DATE" type="date"/>
<key-property name="eptRole" column="EPT_ROLE_ID" type="integer"/>
<key-property name="orgId" column="ORG_ID"/>
</composite-id>
<property name="createdAt" column="CREATED_AT" type="timestamp"/>
<property name="createdBy" column="CREATED_BY"/>
<property name="lastChangedAt" column="LAST_CHANGED_AT" type="timestamp"/>
<property name="lastChangedBy" column="LAST_CHANGED_BY"/>
<property name="rate" scale="2" column="RATE" precision="15" type="big_decimal"/>
</class>
</hibernate-mapping>


database create statement for the table
CREATE TABLE "EPTOWNER"."PROJECT_FINANCE_RATE_EMPLOYEE"
("ORG_ID" VARCHAR(10) NOT NULL,
"COST_CENTER" VARCHAR(10) NOT NULL,
"EPT_ROLE_ID" INTEGER NOT NULL,
"EFFECTIVE_DATE" DATE NOT NULL,
"RATE" DECIMAL(15, 2) NOT NULL,
"CREATED_BY" VARCHAR(8) NOT NULL,
"CREATED_AT" TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP,
"LAST_CHANGED_BY" VARCHAR(8) NOT NULL,
"LAST_CHANGED_AT" TIMESTAMP NOT NULL DEFAULT CURRENT TIMESTAMP
)


domain object snipet
private BigDecimal rate;
/**
* @hibernate.property column="RATE"
* type="big_decimal"
* precision="15"
* scale="2"
* @return rate
*/
public BigDecimal getRate() {
return rate;
}
public void setRate(BigDecimal rate) {
this.rate = rate;
}


hibernate Properties I have set
<prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
<prop key="hibernate.hbm2ddl.auto">validate</prop>
<prop key="hibernate.show_sql">true</prop>
Eric, I had no errors in the javascript console. Everything appeared as I expected, in FireFox

I did change the attribute of the hidden fields to text, so that I could see them, and they showed where I expected them to.

I had the hidden fields in a <tbody> tag, then when srilatha comment, I moved them into a <td> tag. That did not help either.

I hate to waste your time on this further. I am taking another route to accomplish the same thing. It will be easier to code in the long run, but the user will have to wait for an extra post.

Thank you for your time and effort.
I have go another route to implement this since IE does not support the class or style attributes when creating objects and setting the attributes, in the manner I listed previously. Having the page look bad is not an option. I will have to go to the server, save the information, then re-display the page, instead of just adding new rows, then saving once when complete.

Thanks for taking the time to look at my problem.